Results 1 to 8 of 8
  1. #1
    Gregory23 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    28

    Search specific form

    Hello ,

    I would like to create a search button that will take me to an existing form ID and also another button that will print preview the selected form .

    Thanks for the help



    G

  2. #2
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Not really an answer but a hint.
    You don't have answers to your questions (this one, and previous one as well) probably because nobody knows what you asking for (form ID? new record report?). Maybe try in plain English without trying to use Access jargon?

  3. #3
    Gregory23 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    28
    Quote Originally Posted by cyanidem View Post
    Not really an answer but a hint.
    You don't have answers to your questions (this one, and previous one as well) probably because nobody knows what you asking for (form ID? new record report?). Maybe try in plain English without trying to use Access jargon?
    Fair enough

    What I mean is when a new form is entered it will have a unique identifier like a reference (that is what I call form ID) . This reference will be added to the Table as a new record

    For example : There are 5 forms
    • 001
    • 002
    • 003
    • 004
    • 005


    I would like to search for 003 with a search box . With other words would like to create a box that will pop up when a button is hit and will ask "Enter the form reference" -> 003 will be keyed in-> and 003 will open up

    Hope this will explain

    G

  4. #4
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Code:
    Private Sub YourButton_Click()
        DoCmd.OpenForm InputBox("Enter the form reference"), acNormal
    End Sub

    But why entering it manually?
    If you got all forms references in a table, make it a row source for combo box an select from there. Less prone to input mistakes.

  5. #5
    Gregory23 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    28
    Good idea

    thank you for the help ��

  6. #6
    Gregory23 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    28
    Sorry, I rephrase . Would like to open a form with the value in its text box

    Private Sub btnEdit_Click()
    DoCmd.OpenForm InputBox("Enter invoice no"), "Order form", , "Invoice no", " acNormal"
    End Sub

    Click image for larger version. 

Name:	form text box.JPG 
Views:	10 
Size:	13.3 KB 
ID:	23518

    Where did I go wrong ?

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Shouldn't use spaces in object names...... If you do use spaces, you MUST enclose the name with brackets: [Invoice no]

    I never use "InputBox" to get input, but you might try:
    Code:
    DoCmd.OpenForm "Order form", acNormal,, "[Invoice no] = " & InputBox("Enter invoice no")

  8. #8
    Gregory23 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    28
    This solved the issue

    Thanks man

    Cheers

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

Similar Threads

  1. Replies: 3
    Last Post: 09-19-2015, 05:50 AM
  2. Replies: 2
    Last Post: 06-08-2012, 11:22 AM
  3. Search for specific dates
    By natalia in forum Queries
    Replies: 2
    Last Post: 09-27-2010, 03:15 AM
  4. Replies: 2
    Last Post: 08-31-2010, 08:57 PM
  5. Replies: 3
    Last Post: 01-14-2010, 08:32 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