method or data member not found

pbuethe

Returning User
Local time
Today, 13:34
Joined
Apr 9, 2002
Messages
210
I have a form with a combo box and 2 text boxes. I would like to select from the combo box and enter data into the selected record via the textboxes. After I select from the combo box, I get the message "method or data member not found" on the after update code of the combo box, which is as follows:

Private Sub cboTapeNbr_AfterUpdate()

Dim R As Recordset
Set R = Me.RecordsetClone
R.FindFirst "[txtIDNbr] = " & Me![cboTapeNbr]
Me.Bookmark = R.Bookmark

End Sub

![cboTapeNbr] is highlighted in the code when I get this message.
txtIDNbr is the primary key of the table.

Any help is appreciated!
 
Have you tried... Me.[cboTapeNbr]

Otherwise if you use the full name i.e. Forms!YourFormName.cboTapeNbr
 
hi casey,

Your first suggestion had the same result.

The second (specify the form name) brings up the same message, but now "FindFirst" is highlighted in the following code:

R.FindFirst "[txtIDNbr] = " & Forms![frmSURProcessing].[cboTapeNbr]

This is the same with or without the brackets and with a dot (.) or a bang (!) after the form name.
 
I think I see your problem. Try...

dim R as DAO.Recordset

HTH
 
I tried that but it highlighted that line and said "Compile error: User-defined type not defined".

Then I figured maybe it was missing references, so I went into Tools-->References and checked "Microsoft DAO 3.6 Object Library". Then after selecting from the combobox, the message was "Object doesn't support this property or method" and the FindFirst line was highlighted in the code.

Could the problem have anything to do with the fact that the combobox control is on a tab control? Do I need to specify the tab control somewhere, or is what I am trying to do not going to work that way anyway? I have used a combo for selection of a record for data entry before and did not use DAO. However, the combo box was in the form header.

Thanks for your response.
 

Users who are viewing this thread

Back
Top Bottom