Consulting

Results 1 to 2 of 2

Thread: .adb code problem

  1. #1
    VBAX Regular
    Joined
    Aug 2004
    Location
    Upstate NY
    Posts
    12
    Location

    .adp code problem

    Microsoft provides a template db called Events Management.mdb which I have used for a couple of years with great success. This year the company has decided to make the move to SQL Server so I upgraded my template .mdb to a .adp (Access Data Project). Thinking this would be easy :rofl

    IN THE MDB THE REGISTRATION FORM HAS THIS ROWSOURCE:
    SELECT DISTINCTROW Registration.*
    FROM Attendees INNER JOIN Registration 
    ON Attendees.AttendeeID = Registration.AttendeeID
    WHERE (((Registration.AttendeeID)=[forms]![Attendees]![AttendeeID]));
    IN THE ADP I HAVE CHANGED THE CODE TO THIS:
    SELECT DISTINCT Registration.*
    FROM Attendees INNER JOIN Registration 
    ON Attendees.AttendeeID = Registration.AttendeeID
    WHERE (((Registration.AttendeeID)=[forms].[Attendees].[AttendeeID]));
    AND VOILA IT FAILS! No problem I am new to this transition, please don't shoot me.
    It says:
    Error in SELECT clause: expression near '.'
    Unable to parse query text

    I changed the ! to '.' because it didn't like the '!' either. Any insight?
    Last edited by lynn_victoria; 02-02-2005 at 01:10 PM. Reason: spelling error
    For a successful technology, reality must take precedence over
    Public relations, for nature will not be fooled. RF

  2. #2
    VBAX Newbie
    Joined
    May 2004
    Location
    The Netherlands
    Posts
    3
    Location
    Hmm, I'm afraid you'll have to place the value from the form into the recordsource.
    Best probably to use in the form's OnOpen event:
    me.recordsource = "SELECT DISTINCTROW Registration.*
    FROM Attendees INNER JOIN Registration
    ON Attendees.AttendeeID = Registration.AttendeeID
    WHERE (((Registration.AttendeeID)=" & [forms]![Attendees]![AttendeeID] & "));"

    This does however require the "Attendees" form to be open and the field to be filled.

    Nic;o)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •