Runtime error 424 "Object required" (1 Viewer)

aman

Registered User.
Local time
Today, 08:39
Joined
Oct 16, 2008
Messages
1,250
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
 

CJ_London

Super Moderator
Staff member
Local time
Today, 16:39
Joined
Feb 19, 2013
Messages
16,607
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
 

Cronk

Registered User.
Local time
Tomorrow, 01:39
Joined
Jul 4, 2013
Messages
2,771
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.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 01:39
Joined
Jan 20, 2009
Messages
12,851
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
 

aman

Registered User.
Local time
Today, 08:39
Joined
Oct 16, 2008
Messages
1,250
I removed .value and its all working fine. Thanks
 

Users who are viewing this thread

Top Bottom