Results 1 to 8 of 8
  1. #1
    Stretholox is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    24

    OpenArgs and FindRecord combination

    The access website says there is a way to use the open arg in combination with the FindRecord method to open a form up to a specified client name. I'm trying to have a macro that asks the user what student they are looking for and then takes them to the form with that name. The reason I can't use a query or something else is because I have macros on the form page that I want them to have access to.



    So my question is this.

    What's the best way to make a macro that will
    1) ask the user for a name input
    2) open an already made form
    3) take them to a specific record based on the input name

    I tried to use something with InputBox and DoCMD.OpenForm but I'm running face first into a wall any time I tried to combine the two.

    thanks for any help you can give

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Simpler method than using OpenArgs is to have user select student from a combobox then:

    DoCmd.OpenForm "form name", , , "StudentID=" & Me.cbxStudents

    I use only VBA but macro has equivalent.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Stretholox is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    24
    Can you explain what Me.cbxStudents is? I've seen the style of Me.attribute but I'm a novice at programming and access so I've been tripping over it like a fool.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    cbxStudents is example of name for combobox control.

    Me is alias reference for the form the code is behind (also works behind report).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Stretholox is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    24
    Don't combo boxes require me to give them a list of all the names. Can they type the names still? Is there a way to link the combobox to a name list so if I add a name or student it will add it to the combo box?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    A control used only to input filter criteria must be UNBOUND.

    Set the combobox RowSource property. Review: http://www.datapigtechnologies.com/f...combobox3.html

    Adding a new student 'on-the-fly' while making selection in combobox is complicated. Requires VBA code that uses the combobox NotInList event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Stretholox is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    24
    Quote Originally Posted by June7 View Post
    A control used only to input filter criteria must be UNBOUND.

    Set the combobox RowSource property. Review: http://www.datapigtechnologies.com/f...combobox3.html

    Adding a new student 'on-the-fly' while making selection in combobox is complicated. Requires VBA code that uses the combobox NotInList event.
    So I figured out using comboboxes in the form itself but I wanted to make it so there was a drop down menue on a report that combined with a macro button to take the user to the form. Is that possible?

  8. #8
    Stretholox is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    24
    I appreciate the help. I figured it out

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

Similar Threads

  1. Replies: 6
    Last Post: 08-09-2014, 01:09 PM
  2. FindRecord Problem
    By zareh in forum Programming
    Replies: 10
    Last Post: 02-27-2014, 12:22 PM
  3. can not use FindRecord with string
    By john60 in forum Programming
    Replies: 2
    Last Post: 08-10-2013, 08:25 AM
  4. Replies: 5
    Last Post: 01-27-2013, 06:04 PM
  5. Can you use a parameter in findrecord?
    By P5C768 in forum Programming
    Replies: 2
    Last Post: 08-20-2009, 04:36 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