Results 1 to 3 of 3
  1. #1
    Kevin_S is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    2

    Issue passing main_form comboBox data to a subform query.

    Hello Everyone,

    I've been self-teaching myself Access for a week and a half now, so my knowledge base isn't the best. I've got a rather specific question that I've not managed to find an answer to:

    Some Background info on my DB:
    Basic single user DB, not split, just for practice purposes and learning access.

    Say I have a welcome form that launches by default when the database is opened, call it frm_Welcome. I also have a form that contains a subform, call them frm_main and frm_sub.
    frm_main has a combobox, and the selection of this combobox is sent to a criteria field in the query that populates info to the frm_sub. (Done via: [Forms]![frm_main]![docType] --- in this case docType is a comboBox)

    so initially frm_Welcome is open, and frm_main and frm_sub are both closed. When a button on frm_Welcome is clicked, it attempts to opens the main form. This is done by a click event.
    Private Sub ToggleOpenMain_Click()
    DoCmd.OpenForm "frm_main", , , , , acWindowNormal, Null
    End Sub

    The Issue:
    As soon as I click the button, a window prompts me to "Enter Parameter Value".

    If I have the database boot frm_main (ie: completely bypass the welcome form), then everything works well.


    The Question:


    One issue that is causing me grief, is that the subform is opening before the main form. Since the subform has a query that relies on a combo box from the main form, it prompts me with the message "Enter Parameter Value". The reason for this I believe is because the frm_main isn't open yet, so the subform (which opens first) has no reference.

    I'm curious how people with more experience would attempt to solve this issue?


    Any help/feedback is appreciate.
    PS: Since I'm new to access, if someone could suggest a few tutorials on Access I would appreciate it.

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Kevin_S -

    If the form_Main opens without issue except when it is opened from the welcome screen, I suspect the problem might be the code on the button. You have:

    Private Sub ToggleOpenMain_Click()
    DoCmd.OpenForm "frm_main", , , , , acWindowNormal, Null
    End Sub

    I would try...
    Private Sub ToggleOpenMain_Click()
    DoCmd.OpenForm "frm_main"
    End Sub

    and see if that resolves the issue. If not, post back.

    All the best,

    Jim

  3. #3
    Kevin_S is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    2
    Quote Originally Posted by ketbdnetbp View Post
    Kevin_S -

    If the form_Main opens without issue except when it is opened from the welcome screen, I suspect the problem might be the code on the button. You have:

    Private Sub ToggleOpenMain_Click()
    DoCmd.OpenForm "frm_main", , , , , acWindowNormal, Null
    End Sub

    I would try...
    Private Sub ToggleOpenMain_Click()
    DoCmd.OpenForm "frm_main"
    End Sub

    and see if that resolves the issue. If not, post back.

    All the best,

    Jim
    Jim,

    Thanks, this seems to haved fixed the issue.

    -Kevin

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

Similar Threads

  1. Replies: 2
    Last Post: 10-01-2010, 04:28 AM
  2. Form not passing data to query
    By bobfin in forum Queries
    Replies: 13
    Last Post: 08-11-2010, 05:28 AM
  3. Replies: 1
    Last Post: 03-24-2010, 08:42 AM
  4. Passing specific Combobox info to a query
    By pwdpwd in forum Queries
    Replies: 1
    Last Post: 02-09-2010, 12:53 PM
  5. Subform Data Entry Issue
    By yuriyl in forum Forms
    Replies: 3
    Last Post: 05-14-2009, 08:49 PM

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