Object required (not 424 message)

  • Thread starter Thread starter Deborah
  • Start date Start date
D

Deborah

I am trying to add a new record to a table. While all of
the other data will come from boxes on my subform, I need
to add the PubID which is coming from my main form. I have
saved the PubID value in a variable "PidOverall". I have
tried tblMain1.PubId = PidOverall and also
tblMain1.PubID.Value = PidOverall. The message box that
pops up simply says "Object required" (no error message
424, etc) When I F8 through the code when I get to that
line it looks like this - tblMain1.PubID = <Object
required> and then drops down into the error part of the
code. What object does it want?

Deborah
 
An easy way of doing what I think you want to do would be to include a hidden control on your data entry form. On the form load event, set the value of your hidden control equal to the value of the public variable on your main form. I am assuming that all of the controls on your data entry form are bound. Bind the hidden control to the appropriate field. There are more elegant methods, but this method is quick and easy.

Scott Shearer MCSD, MCDBA
(e-mail address removed)

----- Deborah wrote: -----

I am trying to add a new record to a table. While all of
the other data will come from boxes on my subform, I need
to add the PubID which is coming from my main form. I have
saved the PubID value in a variable "PidOverall". I have
tried tblMain1.PubId = PidOverall and also
tblMain1.PubID.Value = PidOverall. The message box that
pops up simply says "Object required" (no error message
424, etc) When I F8 through the code when I get to that
line it looks like this - tblMain1.PubID = <Object
required> and then drops down into the error part of the
code. What object does it want?

Deborah
 
Back
Top