Changing a forms properties under program control

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
0
Utf
11/16/2009 1:08:05 AM
access.gettingstarted 618 articles. 1 followers. Follow

3 Replies
857 Views

Similar Articles

[PageSpeed] 49

Hi Ray,

For calling of Subform, you should change 
Forms.frm_Sub_Address.RecordSource = "tbl_store"

to 

SubformControlName.Form.RecordSource = "tbl_store"

Ray C wrote:
>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

-- 
Message posted via http://www.accessmonster.com

0
Benjamins
11/16/2009 7:43:52 AM
Thanks Benjamin, could you possibly help me a little further with the syntax? 
I assume that I need to insert the sub form name ("frm_Sub_Address") in there 
somewhere but I keep on getting error 424 Object required no matter how I 
change things round.

Thanks for the response and sorry to be a pain.

Regards Ray C


"Benjamins via AccessMonster.com" wrote:

> Hi Ray,
> 
> For calling of Subform, you should change 
> Forms.frm_Sub_Address.RecordSource = "tbl_store"
> 
> to 
> 
> SubformControlName.Form.RecordSource = "tbl_store"
> 
> Ray C wrote:
> >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
> 
> -- 
> Message posted via http://www.accessmonster.com
> 
> .
> 
0
Utf
11/16/2009 2:46:02 PM
Hi,

You need not enter the subform name. You just need to enter the
SubformControlName.form.

Ray C wrote:
>Thanks Benjamin, could you possibly help me a little further with the syntax? 
>I assume that I need to insert the sub form name ("frm_Sub_Address") in there 
>somewhere but I keep on getting error 424 Object required no matter how I 
>change things round.
>
>Thanks for the response and sorry to be a pain.
>
>Regards Ray C
>
>> Hi Ray,
>> 
>[quoted text clipped - 40 lines]
>> >
>> >thanks Ray C

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/200911/1

0
Benjamins
11/18/2009 3:11:33 AM
Reply:

Similar Artilces:

Getting the Information out of the program
Is there a way to get all the information out of the item database and into a spreadsheet? I am trying to create a item catalog for some of our customers and instead of re-entering all the information that we have spent weeks and weeks putting into RMS, there has to be a way to get that out easily. Thanks for all your help There are so many ways you can get the information out of the database. Below are a few. 1. Run a report and click the Export button on the top of the report page, choose File and CSV Comma Delimited.**Easiest 2. Run a SQL Query from SO Admin and export from the Fil...

how create sum function in form field
I'm trying to utilize the sum function in a field on an Outlook 2002 form. I want the form field to sum up the other form fields. Sum is not a function listed in the value tab. Please advise. ...

External data link change
Hi, I've a sheet linked to an external data on the net, and I would like that a cell in this sheet to indicate the last date and time it was updated, the simplest way the better but I can do some programming too. Thanks for your attention, -- Domingos Junqueira No need of help any more, I solved the question. Thanks again ...

how to display a activex control to toolbar?
i want to display a mfc activex control on toolbar, how to do? thanks The articel below shows how to add any control in a toolbar. THat will be a good start: http://www.codeguru.com/article.php/c2547 Another easy option might be to use a CDialogBar, which is based on a dialog template. It might be easy to add ActiveX to a dialog instead. --- Ajay ...

Why does the change change to a number?
Hi all, I've noticed something wierd and always wondered WHY it happens. When you type a date into a cell, and then change the Formatting of it to a 'general' cell, it turns into a number. How does it come up with that number? What is the significance? i.e. type today's date of "12/7/2007" - change it to a 'General' format, and it then says "39423". I'm a trainer of Excel and this question always comes up. I'm curious myself too. Thanks! Joe It's the number of days since January zero 1900 using Excel default for windows (M...

changing the way Excel displays selected cells
Is there a way to change the way Excel displays selected cells? I'm interested in viewing all the selected cells highlighted (with light blue for instance), but by default excel highlights all the cells but not the first one the same occurs when you define a range with no adyacents cells Your definition of the display is not quite correct. Excel highlights the current cell, Excel also highlights a selecte range. The currently selected cell is generally the first of a range, bu press enter and the current cell changes and becomes the second, the third etc in the range. You cannot...

DST changes for Exchange 5.5
I noticed the 2007 DST Calendar Update "Exchange tool" is available now: http://support.microsoft.com/kb/930879 This will seemingly take care of calendars for mailboxes still on Exchange 5.5 servers, as Exchange 5.5 is listed as "compatible" . However would this address the CDO issues such as BlackBerry users and OWA users still on Exchange 5.5 ? Thanks in advance, Itrcb4 On Mon, 12 Feb 2007 14:31:00 -0800, itrcb4 <itrcb4@discussions.microsoft.com> wrote: >I noticed the 2007 DST Calendar Update "Exchange tool" is available now: > >http://su...

Track Changes
How do i remove the track changes in outlook? When i press "Enter", a symbol that represents "Enter" will appears. Same for space etc. ...

more on VBA function name change
I thought I'd start a new thread since I haven't received any replies to my first one... To recap: I've declared a function in a module using mixed case: Function TMDE_Category (FormName As Form) I noticed recently that it appeared in the module as Function tmde_category(FormName As Form) I changed it back to the mixed case declaration, saved the module, exited the app, reopened it and looked. The function had changed back to the all lowercase declaration. Things I've tried since the original post: Using the databse documenter, I selected all ob...

Can't Publish changes with Deploy Manager
After a migration process, I can't publish the changes made on CRM. When I try do this in Deploy Manager I get the follow error: ---------------------------------------------------------------------------- ----- Publish done with errors. See the event log to get deitails NETRA-INOVACAO: ***Error*** Failed to download XSL template files from Web Server ---------------------------------------------------------------------------- ----- Can somebody help me? I don't know if the migration process have any relationship with the error. Thank you for pay attention. []'s Vin´┐Żcius Pitta...

How to change icon for my application
Hi, I am currently developing an application on visual studio 6.0, and i wish to change the MFC icon on my application header. Anyone can help? Thank you. Raed Sawalha wrote: > Hi, I am currently developing an application on visual studio 6.0, and i > wish to change the MFC icon on my application header. Anyone can help? Thank > you. > > Open the icon resource for editing by double clicking. Then notice the control just above the editing grid that lets you switch between editing the large icon and editing the small one. -- Scott McPhillips [VC++ MVP] thanx that work...

How to change newsgroup message font
Like many other ribbon based programs I sometimes struggle to find how to make a change. This time its how to change the font just for newsgroup messages? regards "nobody" wrote in message news:EWTao.39493$GF5.7129@hurricane... > Like many other ribbon based programs I sometimes struggle to find how to make a change. This time its how to change the font just for newsgroup messages? Newsgroup messages are usually plain text. The font used is that selected at [no name tab] > Options > Mail > Read > Fonts for the encoding specified for the messag...

Pass Through query with criteria on a form
I have a Pass Through query that looks like this. select Location,City,State,Country,Pings from (select sd_term_name_loc as 'Location', sd_term_city as 'City', sd_term_st as 'State', sd_term_cntry as 'Country', count(sd_key)as 'Pings' from detail (nolock) where -- ***** The dates below refer to the date and time at which the transaction was loaded to PRM. -- ***** -- ***** The number of pings which have occurred BETWEEN those dates/times will be counted. -- ***** -- ***** Enter the date/time in the format '09/16/2007 14:00:00.000...

Notify change of email address when changing ISP
How do I notify my entire address book of an email address when I change ISP's? Thanks By sending a mail to everyone ? If you do so, please use BCC for the adresses, this way you won't spread everybody's e-mail adres to everybody. Niels Bob Baker wrote: > How do I notify my entire address book of an email address when I change ISP's? > Thanks ...

Change a formula to an acual number
I want to change the formula I have created to the number it has created Example: Cell A1 is the number 1. Cell A2 is the formula =a1+1 creatin the number 2. I want this to be a two not a formula. Any ideas? Laura, copy, then paste special, valves -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2000 & 97 ** remove news from my email address to reply by email ** "Laura" <anonymous@discussions.microsoft.com> wrote in message news...

Problem Changing an Investment Name
I am trying to change an investment name and Money 2006 tells me "The name or symbol 'TRP Spectrum Income' has already been used for a deleted investment. Please enter a different name." When I go to delete investments the name does not appear! Any ideas on how I get Money to accept the name change? This is the first time I have run into this situation and I have made numerous name changes in Money over the years. In microsoft.public.money, Ken wrote: >I am trying to change an investment name and Money 2006 tells me "The name >or symbol 'TRP Spec...

Problem sending the command to the program
Just recently when trying to open an excel document the message of "problem sending the command to the program" pops up. Any solution? ...

Should I change this code?
Should I change 556 to 560???..............Thanks for your help..........Bob Private Sub Command560_Click() On Error GoTo Err_Command556_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmClientInfomation" DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Command556_Click: Exit Sub Err_Command556_Click: MsgBox Err.Description Resume Exit_Command556_Click End Sub On Sun, 15 Jul 2007 16:37:26 +1200, "Bob V" <rjvance@ihug.co.nz> wrote: > >Should I change 556 to 560???..............Thanks for your help.....

symbols won't work in form fields
I have Access 2002. We write a lot of letters in French and as I have a QWERTY keyboard, we have shortcuts for the french letters which are missing from the keyboard. For example Ctrl + e is e with an accute accent, Alt + e is e with a grave accent, and so on. It all works just fine in WORD. But in my forms in my ACCESS database, in my fill-in fields, the shortcuts simply don't work. And there is no "symbol" option available in the tool bar to insert a symbol or French character. Is there any way I can add this function in to the database ? thanks .. Roger ...

How to change default font in Outlook 2003
Can someone tell me how to change tthe default font in Outlook 2003 when composing a new email. It always comes up as Times New Roman. I remember somewhere that I specified that Outlook should use Word as the text editor and that seems to be the case. I have Arial as my default font in Word but this seems to make no difference when using Outlook. Hi, Please go to Tools > Setting > Mail Format > Stationery and Fonts > Fonts It's right there :) On 20 Nov 2005 06:28:45 -0800, amarsarit@gmail.com wrote: >Hi, >Please go to Tools > Setting > Mail Format > Statione...

icon changes with change of extension
when we change the extension of a file in windows, its icon also changes..... how does windows do tht. in my application i require a similar approach. i want the icon to be dependent on the file extension not on the attributes of the file. i have gone trough the registry but things are not very clear. Windows has listed all the file extensions avaliable there, but there is no general way to extract icons for those extension... kindly help icon changes with change of extension "Neelu" <nemesia31@gmail.com> wrote in message news:1161232739.720722.120950@b28g2000cwb.google...

Combo Box on Forms
Hi, I am using a combo box on a form that has several items w/ one being Other. If the user selects other I want them to be able to input what they want so that it will go into the table instead of just the "Other". I just am not really sure on how to do that. Can you help? Thanks, Jaime In design view click on VIEW - Properties and the the combo. Then change Limit To List to No. -- KARL DEWEY Build a little - Test a little "jseger22@yahoo.com" wrote: > Hi, > > I am using a combo box on a form that has several items w/ one being > Other. If the use...

Field Type Change
I am trying to change a free text field to a drop down menu in my current database, that already has data entered for this particular field, in order to avoid multiple versions of the same organization that are just typed in differently. I'm assuming that I'll need to recode the different versions of an entry to make them uniform but after that, I'm unsure how to proceed so I won't lose any data. Is this possible or will I need to delete the field, recreate it as a drop down and then re-enter the data? Thanks in advance! Mike Thanks everyone for all the input and advice s...

Table in Access Form
Hello, I want to put a table in ACCESS form. And the numbers or the text will be used in querries and coding. How can i do this? Thanks... Regards, Create a form with a datasheet view of your table: 1. Select the table you want to use 2. Use the form wizard to create the Datasheet View. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "SupperDuck" <SupperDuck@discussions.microsoft.com> wrote in message news:02BB96B3-879A-4AB0-9CC4-39173D6C54D0@microsoft.com... > Hello, > > I want to put a table in ACCES...

Adding tabs to a form
Hi all! What happens if I add a lot of new tabs to a form, say the Incident form? Will there be a kind of slide bar or something when I deploy the customization, in order to reach the tabs at the most right? Is there a limit in the number of tabs we can add to a form? Thanks in advance! Mathieu. Mathieu, There is a limit of 8 tabs. During my testing, I did not see a scroll bar for the tabs appear. Looks like you need some brevity with tab names... HTH, Dave ------------------------------------------------- David L. Carr, President Visionary Software Consulting, Inc. Main #: 971-3...