Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    AAAndy, novice or not, what part of

    = DLookup("intSubscriptionID", "dbo_tbl_Custom_Subscription_Subscriptions", " varReportTitle = '" & [iVal] & "'")

    includes any reference to a form?



    Perhaps you need to go back to the beginning and explain in simple English what you are trying to do, at the moment it's looking like you are trying to fit a round peg into a square hole. i.e. assuming the code we have been talking about does what you want - and it clearly isn't

  2. #17
    AAAndy is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Aug 2016
    Posts
    68
    Quote Originally Posted by Ajax View Post
    AAAndy, novice or not, what part of

    = DLookup("intSubscriptionID", "dbo_tbl_Custom_Subscription_Subscriptions", " varReportTitle = '" & [iVal] & "'")

    includes any reference to a form?

    Perhaps you need to go back to the beginning and explain in simple English what you are trying to do, at the moment it's looking like you are trying to fit a round peg into a square hole. i.e. assuming the code we have been talking about does what you want - and it clearly isn't
    I'm just trying to display the value of the primary key on my form

  3. #18
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    this is where I'm getting confused - the normal way would be to bind the control to the primary key, but I think you already had that and it wasn't what you wanted as indicated in posts 9 to 11

  4. #19
    AAAndy is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Aug 2016
    Posts
    68
    Quote Originally Posted by Ajax View Post
    this is where I'm getting confused - the normal way would be to bind the control to the primary key, but I think you already had that and it wasn't what you wanted as indicated in posts 9 to 11

    I have about 2000 records in my database and the primary key is the only number that I can use to track everything. I don't want to change the primary key but just display it so that it can be written down and copied into a search form to access it if needed later. So I have all my fields showing up on the form with values from the database but the primary key value will not display. Currently in this form I have two drop downs that search for a certain title.

  5. #20
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    but the primary key value will not display
    under normal circumstances you would not display the primary key since it is a meaningless number used only to uniquely identify a record and is (normally) of no interest to the user.

    You are using 2013 so if the form was auto generated using a wizard the primary key is not included. To display it, in the form design view, on the ribbon, select 'add existing fields' then from the list displayed, drag your primary key field to where you want it on the form.

  6. #21
    AAAndy is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Aug 2016
    Posts
    68
    I will exclude the primary key. Thanks for all your help.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 10-13-2015, 02:53 PM
  2. Replies: 9
    Last Post: 07-22-2013, 03:37 PM
  3. Replies: 3
    Last Post: 04-05-2012, 08:33 AM
  4. Copy Database Code Error
    By Tomfernandez1 in forum Programming
    Replies: 5
    Last Post: 05-03-2011, 12:21 PM
  5. Selecting the State Code
    By TheBigMaple in forum Queries
    Replies: 1
    Last Post: 03-30-2011, 05:34 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