Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Here it is. The only form we are dealing with at the moment is frmHousingEvents. As soon as txtCCS is updated you get the Address error.
    Attached Files Attached Files

  2. #17
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    The problem is you're populating a bound field when you select a new client. I altered it slightly and populated the client id field only if the record is a new record and it's also 'dirty' (something is entered in the record)

    Here's your database back and it's behaving closer to what you want I think. There's a function to test the record in the ON EXIT property of each data entry field and I've locked down the client ID field so it can't accidentally be overwritten.

    Your other option here is to make this form form/subform arrangement so the foreign key to your client table is always enforced.

    PSH Outcomes Demo.zip

    p.s. I don't use bound forms so someone may have a better solution than mine

  3. #18
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Well, it works. A couple of observations. In yours the AfterUpdate event does nothing. I'm curious how the form "knows" the value of cboClientID has changed and to requery the data? I put in a button to set the value of cboClientID and txtFirstName to "", but the form wouldn't update to I did a me.requery.

    Thank you for your solution. I welcome any other suggestions.

  4. #19
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    The after update event of cboClientID does do something.

    It undoes the current record (if the current record hasn't been saved)
    it requeries the form to handle the new selected client
    then goes to the 'new' record on the newly requeried form

    You can't set the value of cboclientID and txtfirstname to "" and get reliable results, they have to be NULL or you will get inconsistent results at best and errors at worst. Null is NOT the same as an empty string ("").

    If you want to clear the form your button click should be something like

    me.undo
    me.cboclientid = null
    me.txtfirstname = null
    me.requery

  5. #20
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Yes I can see that now. I misread the code.

    I put something very near what you have in my Undo button except for using the nulls which I have corrected.

    Thanks again.

    Paul

  6. #21
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Yeah, it's like you're Data Entry property is yes and after the combo update, you're trying to move off the record. Need to see more of the form and db; the visual just shows the record is in edit mode.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. passing a form name to a function woes
    By newbieX in forum Programming
    Replies: 4
    Last Post: 09-26-2014, 02:26 PM
  2. Replies: 2
    Last Post: 01-01-2014, 02:10 PM
  3. Me.Filter with variable woes
    By chris.williams in forum Programming
    Replies: 3
    Last Post: 08-21-2012, 01:03 PM
  4. Combo Box Woes
    By tbassngal in forum Forms
    Replies: 2
    Last Post: 09-01-2011, 08:54 AM
  5. Combo box woes...
    By jonbonazza in forum Forms
    Replies: 3
    Last Post: 06-21-2010, 11:34 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