Results 1 to 4 of 4
  1. #1
    AMJADJ is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jul 2018
    Posts
    34

    Opening another form from current form

    I have a form which has an "unbound" text box where the format in properties is empty (only options I get is for date / time or numbers). I put in a value in this text box on the form lets say 1234.



    I then start filling in the other boxes in the form, one of them which is trailer number, when enter is pressed in this box, the cursor goes to a new line and the trailer box is auto populated with the value from the text box (as above 1234).

    I then have a button which opens a report, which goes into a table and returns all records where the trailer number is equal to the value I put in the text box (in this example 1234), this works fine.

    However instead of 1234 I put in a car reg number i.e. AC33 555, the auto population bit works, but when I click on the button to open the report, a parameter box appears with the label (in this example AC33 555). I cant understand why it wouldn't do it when I have numbers only, but when I put text and numbers it comes with a parameter box.

    FYI, the trailer field is short text within the table, the code to open the report (on click)

    Code:
    strWhere = CStr(Me.Text52)
    DoCmd.OpenReport "RPT Load Manifest", acViewReport, , "Cstr(trailer) = " & strWhere
    so to summarise, if I entered 1234 in the text box and lcicked on open report it works, but when I put a car reg i.e. AC33 555 (have tried without the space, it doesn't.

    Many Thanks in advance for your time.

  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,518
    Note the delimiters required for a text value:

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    AMJADJ is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jul 2018
    Posts
    34
    spot on! Thank you ever so much, works now!

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

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

Similar Threads

  1. Replies: 8
    Last Post: 03-20-2017, 07:22 PM
  2. Replies: 11
    Last Post: 04-09-2016, 08:54 PM
  3. Replies: 5
    Last Post: 01-24-2015, 12:59 AM
  4. Opening ms access db from current using vba
    By deepPowdah in forum Access
    Replies: 4
    Last Post: 03-05-2011, 07:55 PM
  5. Opening one report for current form???
    By GEPC in forum Reports
    Replies: 1
    Last Post: 07-15-2010, 10:46 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