VB Code Help with Form

  • Thread starter Thread starter JNariss
  • Start date Start date
J

JNariss

Hello,

I have a form which is very simple. The user opens the form and selects
an ID # (which is the foreign key to another table), then selects a
date and their name and then clicks the submit button.

Now the problems is that each time the form is opened it shows the last
ID that has been selected and when someone enters a new id number it
will override the one that was shown in the first place.

I would like the form to open so that the user has the ability to enter
the id instead of seeing an id already there.

I have this code behind the submit button:

Private Sub Submit_Click()
On Error GoTo Err_Submit_Click

DoCmd.SendObject acSendNoObject, , , "(e-mail address removed)", ,
, "Submit To Production", "A Request has been submitted to production,
please see the database for more information.", No, False
DoCmd.GoToRecord , , acNewRec
DoCmd.Close acForm, "Submit To Production", acSaveYes
MsgBox "You have successfully submitted your request for
production", vbOKOnly
Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox Err.Description
Resume Exit_Submit_Click

End Sub


Can anyone help me with this? I don't get why my table keeps getting
overridden.

Thanks,
Justine
 
Justine

If you ONLY want to use that ID# as a lookup, not as a way to change the
value in the underlying table, you probably will find that you've "bound"
that form's control to the underlying table ID# field. Empty the control's
Control Source property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top