Runtime error 424 -- "Object required"

allurance

New member
Local time
Today, 01:35
Joined
Jul 27, 2010
Messages
1
First off, I'm a clueless newbie when it comes to VBA. I'm posting this on behalf of a frustrated coworker.

Coworker has a form dropdown list with the names of employees and their organization.

When someone selects an employee name (concatenated with their organization name) from the list, it appears on a textbox in the same form (see picture1).

The employee name that has been selected should then populate a table called table_Router1.

Instead, it brings up a 424 error (see picture2).

How do we correct this? Thanks!



Here is the code, with the error highlighted:

Private Sub Combo7_Click()
nam$ = Me!Combo7.Column(0) & ", " & Me!Combo7.Column(1)
Debug.Print nam$
Me!txtHolder1 = nam$

DoCmd.GoToRecord , "table_Router1", acGoTo, 1

'Update table_router1
Table![table_Router1]!NameNorg = Me!txtHolder1
'Me!txtHolder1
End Sub
Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenTable "table_Router1"
DoCmd.GoToRecord , "table_router1", acFirst
End Sub
 

Attachments

  • picture1.JPG
    picture1.JPG
    20.3 KB · Views: 346
  • picture2.JPG
    picture2.JPG
    34.5 KB · Views: 285
You can't update the table that way. If the value is on the form you can change it via the form. Otherwise, you either need to open a recordset on the table or execute SQL.
 
You can't refer to a table this way:

Table![table_Router1]!NameNorg = Me!txtHolder1


You would have to use an update query or a recordset to update the field. I fear also why do you have a table named table_Router1? Is there a table named table_Router2 or table_Router? If so that would indicate a normalization problem with your database.
 
Okay, I am slow today. :)
 
But you added the normalization thought, so it's like a tie. :p
 

Users who are viewing this thread

Back
Top Bottom