Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    @jwill,


    In order to keep the tables normalized, I made the form unbound and
    I don't understand how having normalized tables and using unbound forms goes together.. Of course I haven't seen the table structure....
    And there is nothing wrong with using unbound forms/controls.... except for a LOT more work involved..
    I once helped a wine importer modify some forms - A2000 format mdb. They wanted to do group adds, edits and deletes (3 new unbound forms). It had 20 rows and 36 columns of text boxes (720 unbound text boxes), plus a handful of other controls. *Lots* of code, but it worked for them.



    It seemed like it was easy to parse the control name for the code and put it in the table
    Rather than use the control name and parse to get the code, you could use the TAG property. For lack of a better example, look at the text box "auditor_ID_txt". Not a bad naming convention. But instead of having to parse the name, put the data/name/code ("auditor_ID") in the TAG property.
    Then you can use

    var_act_control = ctl.Tag

    instead of

    var_act_control = Left((ctl.Name), Len(ctl.Name) - 4)

    to get the code ID. Much simpler...



    I'm curious as to why only the first line gets updated when it finds a match and leaves the other rows unchanged.
    This is back to issue I asked about earlier.
    So you do the .FindFirst with the criteria. No record found, so add a record. OK, no problem.
    On the other hand, using the same criteria, one or more records are found. You edit the first record. But you don't know how many records match the criteria. You would have to have code to loop until there were no more records that matched the criteria. IF you wanted to edit all of the records that matched the criteria. (the alternative would be an update query)


    Just thinking out loud.....

  2. #17
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by jwill View Post
    .....I'm not sure if it will help in this current situation. I'm looking @ the cmdSubmit_Click procedure and it looks like in order for this to work in my application, I would have to enter this on the afterupdate event up each control....
    In order to update the table(s), you only need one event. I incorporated the spirit of your code into a single event. It can be a click event or anything else.

    The click event uses the variables. The load event of the form initiates the variables and sets the variable defaults. The user's interaction with the form either changes the variable or does not. Unless you are allowing the user to change the design of the form, an unbound form has only so many dynamics. The sample provided addresses these dynamics.

    In the end, you need to use what works for you. To me, it seems pretty basic. It is an unbound form. There are only so many things an unbound form can do.

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

Similar Threads

  1. Replies: 2
    Last Post: 02-12-2013, 12:32 AM
  2. Replies: 1
    Last Post: 10-08-2012, 12:04 PM
  3. Forms Freezes After Record Is Updated
    By toonz in forum Forms
    Replies: 1
    Last Post: 10-04-2011, 01:09 PM
  4. Replies: 8
    Last Post: 06-22-2011, 10:51 AM
  5. Query Can it be Done? Mulitple finds
    By Canadiangal in forum Queries
    Replies: 3
    Last Post: 02-28-2010, 03:45 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