Results 1 to 4 of 4
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Open Form From Form Where Criteria is Selected Bank


    I have been implementing some new features to my db. I have a login form wher the user enters blah,blah, and it is from this form that I need to open another form with criteria in place. I get confused with this Where criteria code thing. Here is what I have;

    LoginToCheckRegister Unbound (Form)
    FReg Based on query QRegB (Form)

    Query for Combo35 uses table TBanks to get bankid and Bank i.e. Name of Bank(s)
    bankid
    Bank


    Need to open form FReg with criteria used from Combo25 on form LoginToCheckRegister
    Whatever Bank I select from the combo, I then need to open form FReg with this criteria as the Bank being used.
    Criteria is Bank that is the field name, control on the form FReg and in its table as well.
    FReg forms table is TReg by the way.
    Attached Thumbnails Attached Thumbnails UserLoginScreenToCheckRegister.jpg  

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    So, to be clear, Don't see how this will work! It does NOT know what value I have in Combo35 ?

    Here is my idea, will this work?

    If IsNull Me.Combo35 Then
    MsgBox "You Must Select a Bank From the List"
    Else
    DoCmd.OpenForm "FReg", , ,"[Bank] = Me.Combo35.Value"
    End If

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You are missing:
    the open and close parenthesis for the IsNull function,
    the correct field name (I think),
    and an ampersand in the Where clause

    Code:
    If IsNull(Me.Combo35) Then
        MsgBox "You Must Select a Bank From the List"
    Else
        DoCmd.OpenForm "FReg", , ,"[BankID] = " & Me.Combo35
    End If
    As long as the BankID is numeric (usually a Long), then this should work.

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

Similar Threads

  1. Replies: 3
    Last Post: 09-20-2012, 11:09 AM
  2. Replies: 7
    Last Post: 05-01-2012, 11:43 AM
  3. Open 2nd Form with 2 criteria?
    By Robeen in forum Forms
    Replies: 1
    Last Post: 09-19-2011, 10:20 AM
  4. Replies: 1
    Last Post: 03-31-2011, 12:18 PM
  5. Open (sub)form linking 2 criteria on current form
    By websterh in forum Programming
    Replies: 2
    Last Post: 02-07-2011, 11:56 PM

Tags for this Thread

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