Problemns accessing a subform from a mainform

mcgrcoAgain

Registered User.
Local time
Today, 20:57
Joined
Jan 26, 2006
Messages
47
Hi,

I had a text box on a main form linked to a text box on a sub form using the following control source =Forms!Form![frm_Doctors_details subform].[Form].[Title]. This was working, however I had to play around with the subform alot and now the link isn't working. All i get in the field is #name?. Nothing has changed on the subform textboxs, just that I added a primary key to assist in the linking action bewteen forms. I can't for the life of me get it back to what it was . any ideas??

Thanks in advance
 
Have you changed the name of your main form or maybe the textbox it is linked to, If you would like post your database and i will have a look for you.

Alastair
 
In my experience, the #name? error usually means Access is confused. Rename the control on the SubForm to txtTitle so it will be different than the field to which it is bound. You do not need to go through the Forms collection to reference the control from the MainForm:
=[frm_Doctors_details subform].Form!txtTitle should do it IF [frm_Doctors_details subform] is the name of your SubFormControl!
 
Many thanks for your replies Alaster and ruralguy.I renamed the source to look directly at the subform, as RuralGuy suggested, and now it works. I'm not sure what happened before but for anyone else reading this with a similar problem.

accessing data on a subform from a main form.

Incorrect syntax =Forms!Form![frm_Doctors_details subform].Form.[txtTitle]
right

Right syntax =[frm_Doctors_details subform].Form.[txtTitle]


Thanks again
 

Users who are viewing this thread

Back
Top Bottom