Results 1 to 3 of 3
  1. #1
    DocB1973 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Posts
    3

    Open Form But Don't Run Query Referenced in Control Source


    I know this is an unusual but is there any way to open a form without running the query in the control source. I have a QBF with a main and sub form and I don't want to waste the users time when it opens but rather just when there is a value chosen from the main form's control box.

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    Yes there is a way. Remove the record source from the form's property, making it an unbound form.

    Then in whichever button/event is going to trigger that this form needs to work - you put in there a vba line of code defining the form's property as its record source. Record source is a form property and all form properties can be defined by code.

    Forms.FormName.RecordSource = "NameOfRecordSource"If you want to change the recordsource of a subform on the current form use: Me.NameOfSubformcontrol.Form.RecordSource = "NameOfRecordSource" hope this helps.

  3. #3
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    I should have added - you also have to keep removing the record source too - with a line of vba - i.e. .recordsource=" "

    probably the OnClose event would work for it....

Please reply to this thread with any new information or opinions.

Similar Threads

  1. control source
    By nashr1928 in forum Forms
    Replies: 5
    Last Post: 03-12-2011, 09:31 PM
  2. Control Source
    By sarah54 in forum Access
    Replies: 1
    Last Post: 03-07-2011, 09:00 PM
  3. Textbox Control Source As An Expression help!
    By emilyrogers in forum Forms
    Replies: 11
    Last Post: 02-11-2011, 07:31 AM
  4. one form two sources - invalid control source msg
    By techexpressinc in forum Forms
    Replies: 1
    Last Post: 05-28-2010, 02:11 PM
  5. Replies: 2
    Last Post: 07-30-2009, 08:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums