Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

next record 1

Status
Not open for further replies.

HebieBug

Programmer
Jan 8, 2001
354
JP
when the user pushes a button on the bar at the bottom on the screen (First, back record, next record, last record). Would like to run a line in the VBA.
For example when the user pushes one of these buttons it come up with a message box saying "you have changed records"
 
Well the user shouldn't have to be bugged with a message box it is just bad coding. Depending on whether or not your user needs to change the data or is just looking at it you can change delete, edit, add values on the properties button. Otherwise they should know they have gone to a different record by the navigation bar below (that is the buttons that bring you to the first, next, last, new records)

Nina
 
Nice of you to express yourself.
So now we will go into detail on why this needs to be added to code. As in the first thread said it was an example.
Sometimes to avoid blowing people brains up on to much info it is nice to keep it simple.
The database is a client tracking system which tracks a client through a company and there is pages set for different divisions of that company.
The pages are progressive when it comes from the mail room to the complete stage then it will move to pending on the next page which is operations. The mail room will then become blocked (enabled = false).
This is fine and dandy when you are dealing with one client (record) but that's not the point of a database.
So when the user of this client tracking system pushes the Navagation bar would then like a code written in the background to start. This VBA code reloads block or unblock departements statements.
All in all the question remains the same "When the user pushes the navagation bar can VBA reconise it and then run a series of code from it ?"
Can anyone help out there?
 
Hebiebug, here's your solution:
In the forms "On Current" event in vb you will have to add something like:
MsgBox "You've changed records!",vbinformation,"Record Change Warning."

This warning will appear anytime the record is moved. Unfortunately it will also appear when you initially load the form as well.

To add this double-click on the black square top left corner when your form is in design view. This will bring up the properties dialog. Find the Events tab, then find "On Current". Select "Event Procedure" then click on the ellipse "..." button just to the right. Now VB will open and label up a sub for you. Insert the line above and close and save!
Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top