how do i make a sub datasheet act as a list box

D

druss74

I am trying to create a form that uses a subform datasheet as a selection
tool to control which record is displayed in another subformon this form.
 
J

John W. Vinson

I am trying to create a form that uses a subform datasheet as a selection
tool to control which record is displayed in another subformon this form.

One way you may be able to do this is to use a "relay" control on the
mainform. Put a textbox on the mainform, height and width 0 so you can't see
it; set its control source to

=firstsubformname.Form!controlname

to pick up the Primary Key field that you need as the link.

Make this textbox the Master Link Field of the second subform.
 
C

Chegu Tom

I asked just that question on May first and got answers that helped
Check the responses to my post 'Record source on Subform'

I have a main form with a control that links the first subform which is in
datasheet view
On the on current event of that form I create the SQL for the record source
of the third form

on the on current event of the second form I put code to build an SQL string
strSQL from info on form two and use that to change the record source in
form 3


Dim strSQL, strCriteria As String
strSQL = "SELECT NDEWelds.ProjectID, NDEWelds.Spool, NDEWelds.TaskCode,
NDEWelds.WeldLetter, NDEWelds.Needed, NDEWelds.Done, NDEWelds.NDEPerformed,
NDEWelds.NDEDate, NDEWelds.Weld, NDEWelds.Visual, NDEWelds.VisualDate " _
& "FROM NDEWelds " _
& "WHERE Projectid='" & Me.ProjectID & "' AND Spool ='" & Me.Spool & "'"
_
& "ORDER BY NDEWelds.ProjectID, NDEWelds.Spool, NDEWelds.WeldLetter "

Me.Parent.NDEWeld.Form.RecordSource = strSQL

NDEWeld is the name of the third form (second subform)
 

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