Open Form Code

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I have a control button on my form ,When I click this button I want to go to
frmPrintForms that has the same HorseID number as the Record I am on
The form frmPrintFoms has the same field HorseID....Thanx for any
help....Bob

DoCmd.OpenForm "FrmPrintForms", , , "HorseID ="
 
Hi Bob

You are almost there :-)

All you need to do is add the value of the HorseID to the "HorseID = " bit.

DoCmd.OpenForm "FrmPrintForms", , , "HorseID =" & Me.HorseID
 
Thanks Graham but I got a compile error on Me.HorseID
I have a code on my Main menu that opens it from a drop down list
DoCmd.OpenForm "FrmPrintForms", , , "HorseID =" & Me.cbHorseRemarks
DoCmd.SelectObject acForm, "frmPrintForms"
Thanx..Bob

Graham Mandeno said:
Hi Bob

You are almost there :-)

All you need to do is add the value of the HorseID to the "HorseID = "
bit.

DoCmd.OpenForm "FrmPrintForms", , , "HorseID =" & Me.HorseID

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Bob said:
I have a control button on my form ,When I click this button I want to go
to frmPrintForms that has the same HorseID number as the Record I am on
The form frmPrintFoms has the same field HorseID....Thanx for any
help....Bob

DoCmd.OpenForm "FrmPrintForms", , , "HorseID ="
 
Got it :-))) DoCmd.OpenForm "frmPrintForms", , , "HorseID =" &
Me.Form.HorseID
Thanx Graham
Bob said:
Thanks Graham but I got a compile error on Me.HorseID
I have a code on my Main menu that opens it from a drop down list
DoCmd.OpenForm "FrmPrintForms", , , "HorseID =" & Me.cbHorseRemarks
DoCmd.SelectObject acForm, "frmPrintForms"
Thanx..Bob

Graham Mandeno said:
Hi Bob

You are almost there :-)

All you need to do is add the value of the HorseID to the "HorseID = "
bit.

DoCmd.OpenForm "FrmPrintForms", , , "HorseID =" & Me.HorseID

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Bob said:
I have a control button on my form ,When I click this button I want to
go to frmPrintForms that has the same HorseID number as the Record I am
on
The form frmPrintFoms has the same field HorseID....Thanx for any
help....Bob

DoCmd.OpenForm "FrmPrintForms", , , "HorseID ="
 

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

Similar Threads


Back
Top