Results 1 to 4 of 4
  1. #1
    huongdl1987 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    26

    Double Data Entry Forms

    Hi,

    I'm trying to make a double data entry form in ACCESS. From my internet research, I know that I can create 2 different forms, with the 2nd one unbound to the table, and then write codes to compare. But that's where I'm stucked.

    I have the
    1. Phlebotomy_Lab_Data_Entry table, where the information is located


    2. Phlebotomy_Lab_1st_Data_Entry, which is linked to Phlebotomy_Lab_Data_Entry table
    3. Phlebotomy_Lab_2nd_Data_Entry, in which all textboxes are the same as Phlebotomy_Lab_1st_Data_Entry, but unbound

    I tried to write a code in the BeforeUpdate event on each of the textbox in the 2nd data entry form to compare with the table. Here is an example for the WBC textbox

    Private Sub WBC_BeforeUpdate(Cancel As Integer)
    If Forms![Phlebotomy_Lab_2nd_Data_Entry]![WBC].Value = Phlebotomy_Lab_Data_Entry.WBC Then
    Exit Sub
    Else
    MsgBox "Unmatched, please check entry.", vbOKOnly
    Cancel = True
    Me!WBC.Undo
    End If
    End Sub


    But it kept not working! Do you have any idea what i was doing wrong in the code?

    Thank you so much,
    Meo

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Why doesn't it work, what happens - error message, wrong results, nothing?

    Maybe:

    If Forms![Phlebotomy_Lab_2nd_Data_Entry]![WBC].Value = Me.WBC Then
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    vincent-leeway is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    36
    Well instead of comparing text boxes directly, you must collect the values into the variables properly applying the TRIM functions to remove any preceding and succeeding blank spaces and then compare the variables.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Not following that, vincent. I frequently compare values from textboxes and I've never needed TRIM. Access drops trailing spaces. However, might not hurt to use it in case spaces accidentally typed at beginning but not mandatory to use a VBA declared variable.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Forms, Subforms and Data Entry
    By mikethebass in forum Forms
    Replies: 3
    Last Post: 12-13-2012, 04:08 AM
  2. Building double data entry database
    By Hyunjee in forum Programming
    Replies: 5
    Last Post: 12-13-2011, 10:40 AM
  3. Replies: 0
    Last Post: 03-13-2011, 06:46 PM
  4. Data entry of Web Forms to Access
    By psanghvi in forum Forms
    Replies: 1
    Last Post: 01-31-2011, 02:48 PM
  5. Need Help Relating Forms for Data Entry!!!
    By raymon73 in forum Forms
    Replies: 1
    Last Post: 07-13-2010, 09:42 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