Open form with filter

C

CJ

Hi Groupies

I am using A2K7

I have an unbound form that is used to set up a new service ticket. They
select from an existing job and then they enter a date and ticket
number.Then the user pushes a button and the new service ticket is created
based on the input data.

My problem is this:

The new service ticket is on a subform of the job form. I can get the
correct job to open up and show it's existing service tickets, but I don't
know how to tell the subform to go to a new record and make the ticket
number and date equal to what was on the input form.

At the moment I have the following code on a button on the input form:

Private Sub cmdNewMLT_Click()

DoCmd.OpenForm "frmOpJobMLT", acNormal, , , , , "JobNumber =
Me.cmbJobSearch'"

End Sub
 
B

BodiKlamph

Hi Groupies

I am using A2K7

I have an unbound form that is used to set up a new service ticket. They
select from an existing job and then they enter a date and ticket
number.Then the user pushes a button and the new service ticket is created
based on the input data.

My problem is this:

The new service ticket is on a subform of the job form. I can get the
correct job to open up and show it's existing service tickets, but I don't
know how to tell the subform to go to a new record and make the ticket
number and date equal to what was on the input form.

At the moment I have the following code on a button on the input form:

Private Sub cmdNewMLT_Click()

DoCmd.OpenForm "frmOpJobMLT", acNormal, , , , , "JobNumber =
Me.cmbJobSearch'"

End Sub

Try putting the Me.cmbJobSearch outside of the quote so the *actual*
ID is passed

ie, DoCmd.OpenForm "frmOpJobMLT", acNormal, , , , , "JobNumber = " &
cmbJobSearch
 
C

CJ

Try putting the Me.cmbJobSearch outside of the quote so the *actual*
ID is passed

ie, DoCmd.OpenForm "frmOpJobMLT", acNormal, , , , , "JobNumber = " &
cmbJobSearch

Got it. Thanks a bunch
 

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