RecordSource\ControlSource problems (1 Viewer)

PaddyIrishMan

Registered User.
Local time
Today, 04:28
Joined
Jun 5, 2002
Messages
166
Hi,
I'm probably doing something stupid but... It is Monday morning & I need help..
I have a Generic form. I want to set the forms RecordSource in code so that I can open it from other Forms using different recordsources.
The form has two fields, "Comment" & "Record ID"
Currently, in the click event of a Command Button I have:

SQLString = "SELECT tlb_CurrentTasks.Comment, tlb_CurrentTasks.[Record ID] FROM tlb_CurrentTasks WHERE (((tlb_CurrentTasks.[Record ID]) = 1582));"

(1582 is a hard coded Id for test purposes)
(Glad you're still with me)

Form_frmCommentsPopUp.RecordSource = SQLString
DoCmd.OpenForm "frmCommentsPopup", acNormal

I have the ControlSource properties of the two textboxes on the form set to "Comment" & "Record ID"

BUT... When the form is loaded both text boxes display #Name?
IF I use the above SQL query pasted into the RecordSource Property of the Form in design view then all is Hunky dory.

Does anybody have any ideas to wash away my Monday morning blues?? Pleassse?
 

shay

Registered User.
Local time
Today, 04:28
Joined
Apr 29, 2002
Messages
169
Hi there

Try this:

DoCmd.OpenForm "frmCommentsPopup", acNormal
Forms!frmCommentsPopUp.RecordSource = SQLString

hth

shay

:cool:
 

PaddyIrishMan

Registered User.
Local time
Today, 04:28
Joined
Jun 5, 2002
Messages
166
Knew it would be something simple...
That works nicely!

Thanks Shay
 

Users who are viewing this thread

Top Bottom