Results 1 to 6 of 6
  1. #1
    mann2x is offline Novice
    Windows Vista Access 2007
    Join Date
    Oct 2010
    Posts
    10

    Schedule Conflict Coding

    I need help on a database i am creating. I need to write a vb program which detects if the current inputs already exists or if it is in conflict with existing records.

    My method is I create a query from the current inputs

    qrySQL= Select From [tblRegis].Subject
    Where [tblRegis].TimeIn = '" & txtTimeIn & "'
    And [tblRegis].Days = '" & cboDays & "'
    And [tblRegis].Room = '" & cboRoom & "'
    qd.SQL = qrySQL

    (lets assume that the query is created)



    after that i place the field value of subject into strSubject using DlookUp on the query
    If it is null it means that there are no similar fields in the tblRegis and there is no conflict..
    am i missing anything?because as of now i am not receiving proper outputs..

    If you guys have a solution for this as simple as possible please help me..

  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,640
    For starters, you don't have any fields in the SELECT clause, so I don't think there would be anything for a DLookup() to retrieve. When I test, I get an error trying to run a query like that.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mann2x is offline Novice
    Windows Vista Access 2007
    Join Date
    Oct 2010
    Posts
    10
    Quote Originally Posted by pbaldy View Post
    For starters, you don't have any fields in the SELECT clause, so I don't think there would be anything for a DLookup() to retrieve. When I test, I get an error trying to run a query like that.
    oh yeah i forgot to tell you bout that..any suggestions?

  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,640
    Uh, add the necessary fields:

    SELECT Field1, Field2 FROM...
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    mann2x is offline Novice
    Windows Vista Access 2007
    Join Date
    Oct 2010
    Posts
    10
    Quote Originally Posted by pbaldy View Post
    Uh, add the necessary fields:

    SELECT Field1, Field2 FROM...
    yeah i already got that,lets assume that it is working and my syntax is correct..am i on the right path on checking whether a record will be in conflict or what?have you encountered this before?can you help me out?i can send you my database..plz help me out,i am due in two days..

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    If those 3 fields would uniquely identify a conflicting record then sure, you're on the right track. I'd point out that you're treating all 3 fields as text. I'd expect the time field to be Date/Time (and thus need to be surrounded by # instead of '). If either of the others is numeric you don't want the single quotes surrounding the value. You can post the db here if you want.
    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. Query Conflict
    By isnpms in forum Queries
    Replies: 3
    Last Post: 08-21-2010, 12:01 PM
  2. Replies: 1
    Last Post: 05-02-2010, 05:09 PM
  3. Flight schedule
    By t_g2 in forum Database Design
    Replies: 1
    Last Post: 01-20-2010, 01:13 PM
  4. any way to schedule a compress/repaor task?
    By Coolpapabell in forum Access
    Replies: 7
    Last Post: 10-07-2009, 02:08 PM
  5. Schedule Preparation
    By crapmind in forum Programming
    Replies: 0
    Last Post: 03-08-2009, 09:05 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