Results 1 to 2 of 2
  1. #1
    slaterino is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2009
    Posts
    25

    Trying to find the best way to open a form - whether with a new record or not...

    Hi,


    I'm hoping for a bit of advice on this, as I'm in a spot of confusion over how to use my form when it opens.

    Basically, at the moment I have an OnOpen event on my form, which causes the form to go to a New Record. This is good as it means that when the form opens up it is blank.

    However, it produces one problem. I have 2 drop-down boxes and a button on this page. These combo boxes are used to enter 2 pieces of information. Once that is done, the button is pressed and if there is also a record using these two variables it goes to that record. However, if there is not it creates a new record.

    Because of the way my form is set-up as soon as any information is entered into either of these two fields, a new record is created. If it turns out there is already a record with these variables it will go to that record but it means a blank record will already have been entered.

    The other option is to run the add new record function later once the button has been pressed, but this would mean that the information entered in the 2 combo boxes will be wiped when the new record is created. It also means when the user first opens the form there will instantly be a record on show, which could be confusing.

    Does anyone have any suggestions regarding this issue? Is there a fix I could use or some way I could work around this?

    Thanks!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You could use a DCount() or DLookup() in the BeforeUpdate event of the ComboBoxes to check for duplicates before alowing the update.

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

Similar Threads

  1. Find existing record with multiple criteria
    By TheWedgie in forum Forms
    Replies: 1
    Last Post: 03-25-2009, 10:24 AM
  2. Replies: 4
    Last Post: 03-24-2009, 09:07 PM
  3. Find Record button error
    By Zedlexx in forum Forms
    Replies: 0
    Last Post: 03-11-2009, 09:26 AM
  4. Replies: 0
    Last Post: 10-16-2008, 02:39 PM
  5. How to Find a Record
    By lschlitt in forum Programming
    Replies: 2
    Last Post: 09-09-2006, 06:24 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