R
Ray C
I have a form caled "frm _Main" and that form has a Sub Form called
"frm_Sub_Address" embeded in it. I am wanting to make the "frm_Sub_Address"
get its information from two different Tables depending on what info the user
wants. The two Tables are called "tbl_Stores" and "tbl_Suppliers". I know
that you will raise the question, why do I have 2 tables containing Adddress
info but putting that pointy to one side for the moment, my code is as
follows, depending on what info the user wants :-
iF user wants this info
Forms.frm_main.RecordSource = "tbl_Store"
frm_Sub_Right.SourceObject = "frm_Sub_Address"
*** Forms.frm_Sub_Address.RecordSource = "tbl_store"
frm_Sub_Right.LinkChildFields = "AddrID"
frm_Sub_Right.LinkMasterFields = "AddrID"
ElseIf usr wants this info
Forms.frm_main.RecordSource = "tbl_Suppliers"
frm_Sub_Right.SourceObject = "frm_Sub_Address"
*** Forms.frm_Sub_Address.RecordSource = "tbl_suppliers"
frm_Sub_Right.LinkChildFields = "SupplierNo"
frm_Sub_Right.LinkMasterFields = "SupplierNo"
The lines marked with an asterisk produce the following Run time error 438
Object does not support this property or method
Whereas, if I change the lined to read - frm_Sub_Address.RecordSource =
"tbl_suppliers, I get Run time error 424 Object required.
The idea is that I change the properties of both the Main Form and the Sub
form so that a selection on the main for will fill the records in the Sub
form.
Anyone able to help please?
thanks Ray C
"frm_Sub_Address" embeded in it. I am wanting to make the "frm_Sub_Address"
get its information from two different Tables depending on what info the user
wants. The two Tables are called "tbl_Stores" and "tbl_Suppliers". I know
that you will raise the question, why do I have 2 tables containing Adddress
info but putting that pointy to one side for the moment, my code is as
follows, depending on what info the user wants :-
iF user wants this info
Forms.frm_main.RecordSource = "tbl_Store"
frm_Sub_Right.SourceObject = "frm_Sub_Address"
*** Forms.frm_Sub_Address.RecordSource = "tbl_store"
frm_Sub_Right.LinkChildFields = "AddrID"
frm_Sub_Right.LinkMasterFields = "AddrID"
ElseIf usr wants this info
Forms.frm_main.RecordSource = "tbl_Suppliers"
frm_Sub_Right.SourceObject = "frm_Sub_Address"
*** Forms.frm_Sub_Address.RecordSource = "tbl_suppliers"
frm_Sub_Right.LinkChildFields = "SupplierNo"
frm_Sub_Right.LinkMasterFields = "SupplierNo"
The lines marked with an asterisk produce the following Run time error 438
Object does not support this property or method
Whereas, if I change the lined to read - frm_Sub_Address.RecordSource =
"tbl_suppliers, I get Run time error 424 Object required.
The idea is that I change the properties of both the Main Form and the Sub
form so that a selection on the main for will fill the records in the Sub
form.
Anyone able to help please?
thanks Ray C