Results 1 to 8 of 8
  1. #1
    AndycompanyZ is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    80

    cascading combobox and validation rule violation

    I have also put this on a nother forum but thought I'd hopefully find an answer here as well. I have a form with a couple odf cascading comboboxes on (cmboVenue and cmboVenueRoom). I can't get them to save to the table using a very simple query:
    Code:
    INSERT INTO tblEvent ( VenueRoom )
    VALUES (Forms![frmEvent]![cmboVenueRoom]);
    It runs the query and says I can't update due to Validation rule violations. The structure of the table that the second combobox is based on is


    PK VenueRoomID (autonumber)
    VenueRoom (Text)
    FK VenueID (number) (linked to the tblVenue that gives the output for the 1st combobox)
    There are no required fields in the table and all other usual vaildation violations have been looked for. I have been told its because of the PK and I can't save it inot the tblEvent because of this. I have tried using the venueroom as the bound column in the combobox properties and changing the tblevent to a text field but this also gives the same violation. Can anyone suggest a way around this as i have been working on this for days and getting no where. It is almost the last part of the db problems I have and would be extremely grateful for any advice thanks.

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    What are the fields in tblEvent and their datatypes and do you have any of them set to REQUIRED = YES?

  3. #3
    AndycompanyZ is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    80
    The field it is going into is:
    FieldSize: Long Integer
    Decimal Places: Auto
    Required: No
    Indexed: Yes (Duplicates OK)
    Text Align: General

    Do you mean all the fields in the table? Because yes some will be required as they are behind another form which the user will be required to input some data.

  4. #4
    AndycompanyZ is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    80
    I've just checked and there are 2 such fields.

  5. #5
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by AndycompanyZ View Post
    I've just checked and there are 2 such fields.
    That would be your problem. If you aren't supplying those then the query will fail. Remove the required property from the field at table level and then handle it in their form in the form's Before Update event.

  6. #6
    AndycompanyZ is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    80
    I did that and yes the query now runs but doesn't do what i thought. It is adding a new event but nothing in the field I wanted just a new record to the bottom so its the wrong kind of query isn't it I need an update query not an append don't I. I get very confused with the 2 queries

  7. #7
    AndycompanyZ is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    80
    Sorted it out now thanks a lot. Is ther anywhere I can put solved.

  8. #8
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by AndycompanyZ View Post
    Sorted it out now thanks a lot. Is ther anywhere I can put solved.
    Yes, go up to the top under Thread Tools and select it like this:


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

Similar Threads

  1. Validation Rule
    By ritzzy in forum Access
    Replies: 1
    Last Post: 04-13-2011, 01:33 PM
  2. Help with validation rule
    By Desstro in forum Programming
    Replies: 5
    Last Post: 02-27-2011, 08:05 PM
  3. Validation Rule
    By Christopher in forum Forms
    Replies: 15
    Last Post: 04-20-2010, 06:05 AM
  4. Validation Rule
    By smitstev in forum Access
    Replies: 5
    Last Post: 06-30-2009, 09:58 AM
  5. Validation Rule
    By mistaken_myst in forum Database Design
    Replies: 2
    Last Post: 10-29-2007, 02:08 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