Adding buttons to a sub form

  • Thread starter Thread starter google
  • Start date Start date
G

google

Can some one give me direction. I think this is a simple thing to do
but can not get anything to work.

I have a form with a sub form, the sub form is a Tabular form from a
table. The form only shows a few of the fields.
What i want to do is add two buttons to each record line.

First would be to open another popup form that alowes all the field to
be displayed and edited.

Second is to open a specific report with just the data from that
record. Also i need a way specifying which report to open from one of
the fields in that record.

I guess the answer to one will be similar for both, how to specify
which record to action on.

Thanks
 
DoCmd.OpenForm "frmFormName",,,"ID =" & Me.txtID

Where ID is the name of the Primary Key in the underlying table, and txtID
is the name of the control holding that value in your subform.
 
hi i was wondering is you could explain what you mean in you answer.

I am trying something very similar but as a macro
openform
Itemszz
Form
="[Item Table ID]="&[Item Table ID]

I get 'database engine could not find the object '[Item Table ID] = 9'

9 is refering to the right entry on the subform

regards
 
hi i was wondering is you could explain what you mean in you answer.

I am trying something very similar but as a macro
openform
Itemszz
Form
="[Item Table ID]="&[Item Table ID]

I get 'database engine could not find the object '[Item Table ID] = 9'

9 is refering to the right entry on the subform

regards

I haven't written a macro in almost 11 years. I only use code now because
once you get the hang of it, it is so much easier. If I remember correctly
though, you will need to more explicitly identify your object. Try using the
SetValue action:

[Forms]![Your Form Name]![Item Table ID]
 
Back
Top