A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

unbound combo box



 
 
Thread Tools Display Modes
  #1  
Old December 14th, 2006, 06:13 AM posted to microsoft.public.access.forms
ducat assignment
external usenet poster
 
Posts: 17
Default unbound combo box

I am trying to get an unbound combo box called InmateSelect to lookup and
select data from my primary table called Downinfo. My table fields are
CDCnum, InmateName, and InmateHousing and all are text, no numeric value.
Can someone help me with a code to display all three columns in the combo box
and select the data to be displayed and edited. I want to query the selected
data and print reports.

Please Help
Ducat Assingment
  #2  
Old December 14th, 2006, 09:47 AM posted to microsoft.public.access.forms
Keith Wilby
external usenet poster
 
Posts: 812
Default unbound combo box

"ducat assignment" wrote in
message ...
I am trying to get an unbound combo box called InmateSelect to lookup and
select data from my primary table called Downinfo. My table fields are
CDCnum, InmateName, and InmateHousing and all are text, no numeric value.
Can someone help me with a code to display all three columns in the combo
box
and select the data to be displayed and edited. I want to query the
selected
data and print reports.

Please Help
Ducat Assingment


You don't need any code. Go to your combo box properties and use the query
builder to select your three fields. Next, set the column count to 3 and
set the column widths, then set the bound column. That will display all 3
data elements in "drop-down" mode and the bound data element in "normal"
mode.

HTH - Keith.
www.keithwilby.com


  #3  
Old December 14th, 2006, 02:51 PM posted to microsoft.public.access.forms
ducat assignment
external usenet poster
 
Posts: 17
Default unbound combo box

When I used that method, all three fields were visible and the CDCnum could
be selected and queried but the next two fields InmateName and InmateHousing
were blank (null) or the incorrect record was edited selected when queried.
The CDCnum and other added data was correct but the InmateName and
InmateHousing field were wrong. According to the books and other support
suggestions, I need an unbound combo box and three bound text boxes to make
this work. I need to edit/add data to the selected recorded and that did not
work using this method. Any other Ideas? This is what I have so far. I
cannot get the first field, which is CDCnum (text) to display so I could
select it.

Option Compare Database
Option Explicit

Private Sub Form_Open(Cancel As Integer)
Inmate_Select.RowSourceType = "Table/Query"
Inmate_Select.RowSource = "DOWNINFO"
Inmate_Select.ColumnCount = 3
Inmate_Select.ColumnWidths = "0"
End Sub

Private Sub Inmate_Select_Click()
Dim strSQL As String
strSQL = "Select * FROM CDCnum " & _
"Where CDCnum = " & Inmate_Select.Column(1)
Debug.Print strSQL
Forms!Inmates.RecordSource = "&&&&&&&"
End Sub

Thanks for any help


"Keith Wilby" wrote:

"ducat assignment" wrote in
message ...
I am trying to get an unbound combo box called InmateSelect to lookup and
select data from my primary table called Downinfo. My table fields are
CDCnum, InmateName, and InmateHousing and all are text, no numeric value.
Can someone help me with a code to display all three columns in the combo
box
and select the data to be displayed and edited. I want to query the
selected
data and print reports.

Please Help
Ducat Assingment


You don't need any code. Go to your combo box properties and use the query
builder to select your three fields. Next, set the column count to 3 and
set the column widths, then set the bound column. That will display all 3
data elements in "drop-down" mode and the bound data element in "normal"
mode.

HTH - Keith.
www.keithwilby.com



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.