#Name in subform controls ---- KRISH

G

Guest

Hi!
I would like to set new recordsource to my subform on changing a combobox in
the main form. My code is as below:
If Me.txtLett = "Interview" Or Me.txtLett = "Final Admn" Then
Me.Call_Letters_Sub_2.Form.RecordSource = QRYCallLettUPDTIntAdmn
ElseIf Me.txtLett = "Adv. Admn" Then
Me.Call_Letters_Sub_2.Form.RecordSource = QRYCallLettUPDTAdvAdmn
End If

I am displaying the subform in datasheet view.
The above code is showing #Name against all controls of the subform. No
problem when I open the subform separately.
Please help how to solve the problem.
Thanks
Krish
 
D

Duane Hookom

You might want to just set your subform control Source Object to your query:
Me.Call_Letters_Sub_2.SourceObject = "Query.QRYCallLettUPDTIntAdmn"
 
G

Guest

Sorry! its giving Application Error.

Duane Hookom said:
You might want to just set your subform control Source Object to your query:
Me.Call_Letters_Sub_2.SourceObject = "Query.QRYCallLettUPDTIntAdmn"
--
Duane Hookom
MS Access MVP

-
 

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