Record Selection in Datasheet View of subform

P

paxdak

I haven't been able to get the following situation to work:

I was able to get a form to use checkboxes and comboboxes to allow the
user to select what criteria to query the recordset with.
The user picks selection in various combox boxes and hits a command
button.
The command button creates the query string and updates the subform using
the following code:

Me!subform_A.Form.RecordSource = strSQL

The subform updates correctively and show sthe correct records in
DataSheet view.

I'd like the user to be able to select a record in the subform
(subform_A), and press another command button to open up a new data entry
form.

How do I pass the active record (shown with recordselector next to it)
from the subform to the new form?
Also, if a specific record is not selected, can the new form open with the
entire recordset from the subform?
And lastly, if a multiple records are selected, can the new form open
with the that recordset from the subform?

Any help is appreciated. Thank you.
 
P

paxdak

I was able to get the new form to open based on the active selection in
teh subform by using the following code:

strDocName = "frm_DataEntry"
strLinkCriteria = "DocNumber = '" & Me!subform_A.DocNumber.Value & "'"
DoCmd.OpenForm strDocName, acNormal, , strLinkCriteria, acFormEdit

Haven't gotten it to work for the entire subform recordset or a multiple
record selection.


-----------------------------------------------------------------------------------------------------------------

I haven't been able to get the following situation to work:

I was able to get a form to use checkboxes and comboboxes to allow the
user to select what criteria to query the recordset with.
The user picks selection in various combox boxes and hits a command
button.
The command button creates the query string and updates the subform using
the following code:

Me!subform_A.Form.RecordSource = strSQL

The subform updates correctively and show sthe correct records in
DataSheet view.

I'd like the user to be able to select a record in the subform
(subform_A), and press another command button to open up a new data entry
form.

How do I pass the active record (shown with recordselector next to it)
from the subform to the new form?
Also, if a specific record is not selected, can the new form open with the

entire recordset from the subform?
And lastly, if a multiple records are selected, can the new form open
with the that recordset from the subform?

Any help is appreciated. Thank you.
 

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