Syntex code in a combo box

handjt

New member
Local time
Yesterday, 19:26
Joined
Aug 27, 2004
Messages
5
Hi y'all!

I have a form that a user can search for records four different ways. I have another form that displays the results called Results (Clever, I know :D ). I want the combo box on the results form to list the records that match the criteria given by the user. I also want to be able to click on that record and have it show the information. Seems simple :eek: I cannot seem to figure it out. I have it displaying the information on my form even in the combo box, however it will not list the other records (and I know they are there). Here is the line I am having problems with.

Form_SearchResults.NDW_.value = rs3![NDW]

The .value is the problem. I also have tried AddItem, ItemData. No luck :( . I'm getting really :mad: So if anybody can help, I'd really appreciate it :D Thanks a million!!!
 
.value is the problem
- the value property is the default and so it can be omitted.

Form_SearchResults.NDW_ = rs3![NDW]

I take it your NDW field name actually ends with some punctuation character. Notice how VBA converts it to an underscore because it doesn't like it. In the future, avoid special characters and embedded spaces in all your names.

I want the combo box on the results form to list the records that match the criteria given by the user.
- you need to replace the RowSource for this combo with one that will select the rows you want to see. You can build the RowSource query in VBA based on what the user chooses on the selection form.
 
I omitted the .value and changed the rowsource to value list. It still isn't doing what I had hoped it would do. However, I think that there should be another statement following the one that is listed instructing Access to LIST or ADD the records in the combo box using the ndw#. (I have definately learned my lesson on using the "special" characters :D ) I don't have a clue as to what it could be. Some type of syntex. I'm trying to build it in VBA as you instructed, I just need a little help doing so, so any help on being able to tell Access to list the records would be greatly appreciated. Thanks a million!!
 
Let me try again. In VBA, you will need to build an SQL string that selects the rows that the user wants to see based on the options he chose on your form. After the SQL is built, you place it in the combo's RowSource.

Me.YourCombo.RowSource = strSQL
 

Users who are viewing this thread

Back
Top Bottom