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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|