Results 1 to 2 of 2
  1. #1
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110

    OpenArgs - Passing a Prefixed Auto Number

    Hello



    I am doing a simple DoCmd, OpenArgs.

    Code:
    DoCmd. OpenForm "FrmNewDocument",,,"BCPKey = " & Me.[BCPKey],,, Me.BCPKey
    with the following OpenArgs

    Code:
    If Me.OpenArgs <> "" Then
    Me.[BCPKey].DefaultValue = "" & Me.OpenArgs & ""
    End IF
    However the BCPKey is a Primary Key with a a format of "BCP"0

    Now, viewing this information in my datasheet I have the the prefix, but how do I add the prefix to the new form being opened?

    Regards

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    Have you checked to see what is actually being passed to the form in the open args?

    I would simply format it the same ("BCP"0) in the New Document form?
    You want it to be the same actual underlying data, so just ensure it is handled in the same way.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Evaluate the number in a text field prefixed by "<" or ">"
    By Glen Simple Scientist in forum Programming
    Replies: 7
    Last Post: 12-30-2020, 08:00 AM
  2. Replies: 33
    Last Post: 09-22-2020, 04:37 PM
  3. Replies: 14
    Last Post: 05-26-2015, 04:30 AM
  4. Replies: 5
    Last Post: 01-27-2013, 06:04 PM
  5. Replies: 10
    Last Post: 12-21-2010, 12:41 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