Opening a subform to enter data to the current record in the paren

G

Guest

I have designed a Parent form called Daily Dispatch Log. However I rarely
enter vehicle information so I wanted to use a command button to open a
subform to enter vehicle information when I need to. The subform opens to
record 1 instead of the current record that the parent is working in. What
needs to be done.

Thanks Jen
 
G

Guest

Subforms are forms that are embedded in a parent form and
are open all the time. Parent and child will not be
synchronized unless the linked fields are specified in
the subform control.

However, it sounds like you want a pop-up form that
displays infrequently used/edited info.
- create the pop-up form and specify the property
for "pop-up" to Yes.
- set the modal property to "Yes" if you want your users
to deal with that form before going back to the parent.
- the command line in your parent form command button
should contain a "where condition" that contains the
linked info...

Dim strLinkCriteria as String
strLinkCriteria = "[intVehicleID] = " & Cstr(Me!
[intVehicleID])
db.OpenForm "frmVehicleInfoPop",,,strLinkCriteria
 
G

Guest

This is what I have so far but I can't seem to get yours to run..I keep
getting a run time error when I add it to what I have:


Private Sub Vehicle_Information__Form_Click()
On Error GoTo Err_Vehicle_Information__Form_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Vehicle"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Vehicle_Information__Form_Click:
Exit Sub

Err_Vehicle_Information__Form_Click:
MsgBox Err.Description
Resume Exit_Vehicle_Information__Form_Click

End Sub


Subforms are forms that are embedded in a parent form and
are open all the time. Parent and child will not be
synchronized unless the linked fields are specified in
the subform control.

However, it sounds like you want a pop-up form that
displays infrequently used/edited info.
- create the pop-up form and specify the property
for "pop-up" to Yes.
- set the modal property to "Yes" if you want your users
to deal with that form before going back to the parent.
- the command line in your parent form command button
should contain a "where condition" that contains the
linked info...

Dim strLinkCriteria as String
strLinkCriteria = "[intVehicleID] = " & Cstr(Me!
[intVehicleID])
db.OpenForm "frmVehicleInfoPop",,,strLinkCriteria
-----Original Message-----
I have designed a Parent form called Daily Dispatch Log. However I rarely
enter vehicle information so I wanted to use a command button to open a
subform to enter vehicle information when I need to. The subform opens to
record 1 instead of the current record that the parent is working in. What
needs to be done.

Thanks Jen
.
 

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

Top