Runtime error 424 "Object required"

aman

Registered User.
Local time
Today, 07:32
Joined
Oct 16, 2008
Messages
1,251
Hi Guys

I am getting the above error message in the following line of code. I have a tab control named tbmain and these controls are on the first page .
Code:
  .Fields("Ename") = cboAgent.Column(1).Value
 .Fields("Mname") = Me.cboAgent.Column(1).Value

ANy help will be much appreciated.

Thanks
 
please be clearer - 'the following line of code' - you show 2 lines. Also, please provide the context for the code - .fields of what? and the rowsource to cboAgent. you have provided the equivalent of asking someone to correct a sentence and only providing a couple of words.

Only thing I can suggest is don't use .value and check you combo has at least 2 columns
 
You'll have more chance of getting help if you post all of the relevant code instead of just the lines where the error occurs, especially who you are trying to open the re
cordset.
 
My guess is that you copied the code out of context and missed the associated With block header and trailer. Looks like it is probably a recordset.

Code:
Set rs = Currentdb.CreateRecordset("somequery")
With rs
    .Edit
    .Fields("Ename") = Me.cboAgent.Column(1).Value
    .Fields("Mname") = Me.cboAgent.Column(1).Value
    .Update
End With
 
I removed .value and its all working fine. Thanks
 

Users who are viewing this thread

Back
Top Bottom