Grabbing data from form fields

  • Thread starter Thread starter Dr. Confusion
  • Start date Start date
D

Dr. Confusion

Guest
i've got a simple task of comparing data from the stored record and the data the user is entering in to the form field.
getting data from the stored record is easy = using the oldvalue property.

what i'm lost on is getting data from the user into a variable WITHOUT updating the record. pulling it "live" from the form.

i would then compare the values and execute the rest of the code. any help would be greatly appreciated.
-thanks, dr. confusion
 
You could use unbound fields but then you would need to code the update logic yourself.
 
Heres another idea

I entered this into project two years ago - works but would appreciate reply if any errors found
as it does'nt perform ideally all the time - maybe becouse of my tables set up

Try in yr bound fields After_Update event:

Forms![x].RecordsetClone.MoveFirst
Do Until Forms![x].RecordsetClone.EOF
''Nameofcontrol' is bound to 'NameofField'
If Forms![x].RecordsetClone("NameofField") = Me![Nameofcontrol] Then
'shows msg if same value found in table
If MsgBox("xxxxxxxxx." & Chr(10) & Chr(13) _
& "Press YES, to continue and amend " & Chr(10) & Chr(13) & "NO, to UNDO" _
& " entry and display the record with this name.", 48 + 4, "Information") = 6 Then
'here set focus to original control, maybe via another if necessary ie an error occurs
Else
'NO user choses undo and display original item
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Forms![x].Bookmark = Forms![x].RecordsetClone.Bookmark
End If
Exit Do
Exit Sub
End If
Forms![x].RecordsetClone.MoveNext
Loop
Refresh
 

Users who are viewing this thread

Back
Top Bottom