Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Combo Sync problem

Status
Not open for further replies.

SCubed

Programmer
Jan 6, 2004
26
US
I have read every combo box sync problem posted and have not successfully been able to get mine to work. I am close, but that's about it. Here's the situation:

Combo Box 1 name = ComboEquipType
Combo Box 2 name = ComboSerialNumber

ComboSerialNumber has a Source Type of "Table/Query" and the Row Source has a SELECT query as follows:

SELECT ASSETS.AssetID, ASSETS.Description
FROM ASSETS
WHERE (((ASSETS.EquipmentType)=[Forms]![EquipMoves]![ComboEquipType]));

In the AFTERUPDATE event of ComboEquipType is have the following code:

ComboSerialNumber.Requery

When I select a value from the ComboEquipType box, instead of it passing the value selected into the query, it gives me the CRITERIA PROMPT box as if it didn't receive a value. If I then type in the value, the list in the 2nd combo box works fine.

How do I get the value to pass without it prompting for me to enter it in the CRITERIA PROMPT box?

Thank you in advance!



 
Put this in
Private Sub ComboEquipType_AfterUpdate()
me.ComboSerialNumber.RowSource="SELECT AssetID, Description
FROM ASSETS WHERE (((EquipmentType)='" & ComboEquipType & "'));"
Me.ComboSerialNumber=Me.ComboSerialNumber.Itemdata(0)

End Sub

This should do it.

MakeItSo

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
I inserted your code in place of my "requery" line of code, but the exact same thing happened. Any other suggestions?

Thank you.
 
Happy New Year SCubed . . . . .

Are you dealing with the bound column of ComboEquipType or the text value?

If its the text value don't forget to append the same when you reference the control. Such as:

[Forms]![EquipMoves]![ComboEquipType].Text


TheAceMan [wiggle]

 
Ace Man,

Happy New Year to you too! I am dealing with a Bound column. Do you have any other advice?

SCubed
 
OK SCubed . . . . .

What Access version are you using?

Either way, need to check references here for starters. Open any module. Click Tools - References. Your looking for Microsoft DAO 3.6 Object Library. Make sure its checked and pushed as high in priority as it will go. See if this corrects the problem if it was not checked.

I assume both comboboxes are on the same form; Yes?

Are you saying the prompt is asking for ComboEquipType?

Are you sure there are no typos? For instance EquipMoves should be EquipMove?



TheAceMan [wiggle]

 
OK, it is fixed! I had placed the AfterUpdate code in the incorrect place.

Thanks to all!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top