New entry form with value from another form

guestbb

Registered User.
Local time
Today, 08:17
Joined
Jul 14, 2015
Messages
44
I have two forms. Main form called "frmCarV" and another form "frmEngine"
The form frmCarV contains the its ID called VID that is connected with the frmEngine also.
I made a button on frmCarV form that when click opens form frmEngine as a new entry (because the form is for entering certain data) with the VID field already filled from the VID field in the frmCarV form where data about each car is put.

This is the VBA I placed in the button in the Main form frmCarV.

Private Sub btnUnosEvidR_Click()
DoCmd.OpenForm "frmEngine", , , "VID=" & Me.VID
End Sub

When I click the button form opens but the VID field is not filled, it stays blank. Also the VID field in the form frmEngine is a combobox if that helps.
 
Last edited:
you dont need any code for this.
if frmEngine is the sub form, then just type values into the sub form.
no code.
 
I said it wrong. It is not a sub form just another form that i look at as a sub form. It is two different forms.

I edited the post.
 
Last edited:
Ok so I just solved it.

Private Sub btnUnosEvidR_Click()
DoCmd.OpenForm "frmEngine"
Forms!frmEngine!VID = Forms!CarV!VID
End Sub
 

Users who are viewing this thread

Back
Top Bottom