Results 1 to 3 of 3
  1. #1
    lukekelly is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    8

    Form Dlookup macro

    Hi all,

    Ive had a search for an hour or so to the solution of my problem, but nada so far so thought id drop a quick post,

    Lets say i have one table, ive created a form to display certain records in that table. What i wanted to do is to enable an onclick function onto the record ID so it opens a form of the single record. I thus far have managed to do that by the following:



    in 'before update' started macro with the 'Set Value' command with the following:

    Item:
    Code:
    [Forms]![Tickets Internal Assigned Table View]![ID]
    Expression:
    Code:
    DLookUp("[ID]","[ID] = Forms![Tickets Internal Assigned Single View]![ID]")
    then an 'onlick' macro of opening the "single view" form - i have tried changing the form names around etc, because its the same table lookup i just want it to pull the record number up that is click, at the moment it is only selecting the first record.

    Does anyone have any suggestions? Thanks in advance

    Luke

  2. #2
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Hi Luke,

    If this is the only location where you use your "single record" form, and assuming you use a select query for that form, then add:

    Code:
    [Forms]![Tickets Internal Assigned Table View]![ID]
    as criteria for the ID field.

    If it isn't the only occasion you use the form, you could make a copy of it (and the query) for this purpose.

    Cheers,

  3. #3
    lukekelly is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    8
    Thanks for your reply ConneXionLost,

    I have actually sorted since writing this first post, so ill post what i did

    I replaced the Expression

    Code:
    DLookUp("[ID]","[ID] = Forms![Tickets Internal Assigned Single View]![ID]")
    with
    Code:
    DLookUp("ID","Tickets Internal Assigned Single View")
    And also i never done the query for it -.- hehe yeh i know, but it came to me an hour later, well the query anyway!

    just had to link the table to its own id and yes as you correctly said with, just a quick question tho if you could possibly answer this the dlookup code i had in first time around, is there a problem with it? i mean i never tried after seeing as i changed the dlookup first then added the query after. Sorry just trying to get my head round these little problems to better my understanding!

    Thanks

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

Similar Threads

  1. Replies: 2
    Last Post: 11-04-2009, 09:45 PM
  2. Replies: 3
    Last Post: 10-16-2009, 07:54 AM
  3. Dlookup
    By janjan_376 in forum Access
    Replies: 20
    Last Post: 07-07-2009, 07:40 AM
  4. Form to enter all parameters in a macro
    By jackthedog in forum Access
    Replies: 0
    Last Post: 05-05-2009, 04:47 PM
  5. Replies: 1
    Last Post: 05-01-2009, 07:33 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