A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

subform - click on control



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2004, 05:48 AM
David Norman
external usenet poster
 
Posts: n/a
Default subform - click on control

How do I put a "check box' (or something similar) next to each record
that appears in a subform so that the user can click on it and see a
new related form that expand the information.

eg if the customer(main form) is Pizza Hut and the subform lists all
their locations, I want the user to click on a check box for a
specific location and see all the related information for that
location (from another table or form)

Thanks
  #2  
Old May 27th, 2004, 07:31 AM
tina
external usenet poster
 
Posts: n/a
Default subform - click on control

first, suggest you don't use a checkbox. because it will be an unbound
control, when you check the box in one record in a continuous (or datasheet)
subform, it will look like you've checked *all* the records - very confusing
to your users.
instead, you might put the code to open the "location details" form on the
location field's double-click event. so if i want to see this location, i
double-click the location number and the detail form pops open.

as for the code itself: your subform's underlying "locations" table should
have a primary key field that uniquely identifies each record. i'll call it
LocID. the OpenForm action needs to include a WHERE condition (see Help for
details, for macros or VBA code) that refers to that unique ID to filter for
the single record you want, something like

"[LocID] = " & Forms!MainFormName!SubformControlName!LocID

in VBA, or

[LocID] = [Forms]![MainFormName]![SubformControlName].Form![LocID]

in a macro.

hth


"David Norman" wrote in message
om...
How do I put a "check box' (or something similar) next to each record
that appears in a subform so that the user can click on it and see a
new related form that expand the information.

eg if the customer(main form) is Pizza Hut and the subform lists all
their locations, I want the user to click on a check box for a
specific location and see all the related information for that
location (from another table or form)

Thanks



  #3  
Old May 28th, 2004, 02:24 AM
David Norman
external usenet poster
 
Posts: n/a
Default subform - click on control

"tina" wrote in message ...
first, suggest you don't use a checkbox. because it will be an unbound
control, when you check the box in one record in a continuous (or datasheet)
subform, it will look like you've checked *all* the records - very confusing
to your users.
instead, you might put the code to open the "location details" form on the
location field's double-click event. so if i want to see this location, i
double-click the location number and the detail form pops open.

as for the code itself: your subform's underlying "locations" table should
have a primary key field that uniquely identifies each record. i'll call it
LocID. the OpenForm action needs to include a WHERE condition (see Help for
details, for macros or VBA code) that refers to that unique ID to filter for
the single record you want, something like

"[LocID] = " & Forms!MainFormName!SubformControlName!LocID

in VBA, or

[LocID] = [Forms]![MainFormName]![SubformControlName].Form![LocID]

in a macro.

hth


"David Norman" wrote in message
om...
How do I put a "check box' (or something similar) next to each record
that appears in a subform so that the user can click on it and see a
new related form that expand the information.

eg if the customer(main form) is Pizza Hut and the subform lists all
their locations, I want the user to click on a check box for a
specific location and see all the related information for that
location (from another table or form)

Thanks



Many thanks for the help. Should work fine
N.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.