Combo Box

clauses

Registered User.
Local time
Today, 00:38
Joined
Feb 9, 2001
Messages
56
I have developed a form that is bound to a table utilizing a combobox to select a record to examine. Everytime I select a new reord to examine with the combo box I am unable to view the record I have selected. I tried using an openform command in the afterupdate event but I get a message that the openform was cancled, and when I select help from this message I get no help at all telling me whats wrong. My openform statment takes the following form

.OpenForm "frmName", , , "fieldName = forms!frmName!cboName"

This has worked with other forms that I have developed without diffculty, why would it be giving me problems now. Can anyone give me an idea where to look.
 
Do you have a primary key control on your form?

A way to do this is to create a control or text box bound to the ID of table to which the form is bound (make it hidden if you want).

On the combobox afterupdate event use the following code

DoCmd.GoToControl "txtID"
DoCmd.FindRecord Me.cboName.Column(0), acEntire

(where cboName.Column(0) is the column referencing the same ID field of the table as txtID)
 

Users who are viewing this thread

Back
Top Bottom