data entry

  • Thread starter Thread starter faapa via AccessMonster.com
  • Start date Start date
F

faapa via AccessMonster.com

Hey all

i was wondering if someone can help me tweck this code..i'm trying to make
the user enter infomation in a textbox (v_actual_source) if they click a
button (btnAchieved). I don't want the user to exit it the form without
entering info in that textbox as i have another button they can press once
they have entered info in v_actual_soruce that wipes out the info (resets it)


So far, add code in the btnAchieve_Clikc()

If IsNull(Me.V_ACTUAL_SOURCE) Then
Cancel = True
MsgBox "Please Enter Source Name", vbOKOnly + vbCritical, "Data Requirement
Error"
End If

itonly pops up a msg reminding the user that they must complete the
v_actual_source textbox but still allows the user to exit the form without
entering info in that textbox.

Does anyone know what the extra bit of code is to stop the user from exiting
the page unless the extra info is added??
 
thanks guys, theres only one problem...

i have a form that requires the user to enter infomation into certain fields
before the record can be saved. Once the data has been saved, 2 buttons
become enabled, allowing the user to click them to 'validate' the data
entered...if the user decides to validate using (btnAchieved) then a textbox
next to it become unlocked and hence - i want a msg to come up telling the
user they MUST enter a souce name (v_actual_source). Even if they pressed the
button by mistake, they must enter a name (as there is another button that
clears the validation bit of the form)

So far, i've tried to create a critera saying -

If Me.Result_box = "Achieved" or "not achieved" then
me.v_actual_source = not null
msgbox = "must enter data"
cancel = false
me.v_actual_source.setfocus
end if

HOWEVER - it kinda worked, the msgbox came up BUT i could still exit the form!
!

p.s - if btnAchieved is pressed - "Achieved" populates the Result_box. If
btnFailed is pressed then "Not Achieved" appears in the result_box. If the
Clear button (btn_unverify) then Unverified populates the result box. (i dont
need the user to enter a source name in v_actual_source when Unverified.
 
ALWAYS POST YOUR FIXES! What happens when the next guy does a search
and finds this post with no fix attached??
 
Back
Top