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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime Error '424' Object Required 2

Status
Not open for further replies.

m10biker

Programmer
May 18, 2008
3
US
I am getting "Runtime Error '424'. Object Required" when I try to execute the following code.

Command60 command button is on the form frmLabStatus. Column(6) contains the name of the form to be opened using this command button. Once that form is opened, a field's value on that form "cboTestID" needs to be set to Column(5) on the previous form "frmLabStatus".

Your help is highly appreciated!


Private Sub Command60_Click()

DoCmd.OpenForm Me.listProjects.Column(6)
Forms!frmLabStatus.listProjects.Column(6).cboTestID = Forms!frmLabStatus.listProjects.Column(5)

End Sub
 
Possibly:
Code:
Dim strFormName As String

strFormName = Me.listProjects.Column(6)

DoCmd.OpenForm strFormName

Forms(strFormName).Controls.cboTestID = Me.listProjects.Column(5)

 
I still get the error"compile error Method or Data member not found" and the cboTestID is highlighted.

Thank you.
 
or:
Code:
[blue]   DoCmd.OpenForm Me.listProjects.Column(6)
   DoEvents
   Forms!frmLabStatus.cboTestID = Me.listProjects.Column(5)
[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
The cboTestID is not on the form frmLabStatus. It is on form given by Me.listProjects.Coumn(6)
 
m10biker . . .

I believe there's a mixup between comboboxes and [blue]actual column's[/blue] on frmLabStatus (the syntax of the code looks like combobox references)!

In the following code [blue]you![/blue] substitute proper names/values in [purple]purple[/purple]:
Code:
[blue]   Dim OpnFrmName As String
   
   OpnFrmName = Me![[purple][B][I]Column6TextboxName[/I][/B][/purple]]
   DoCmd.OpenForm OpnFrmName
   DoEvents
   Forms(OpnFrmName)!cboTestID = Me![[purple][B][I]Column5TextboxName[/I][/B][/purple]][/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
I goofed, should be:
Code:
Forms(strFormName).Controls("cboTestID") = Me.listProjects.Column(5)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top