User Forms - Next/Previous Records

Bcarter

New Member
Joined
Dec 19, 2003
Messages
8
I just completed my first userform and it is almost complete. However, my boss just informed me that he would like to have a next and previous record command buttons on the form as well. Can someone please help me with the codes?

Any help would be appreciated!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I'd like to see the solution to this too. Need your help Bcarter - what does your userform do? Where does it put it's "records"?

What kind of controls are on the form?
 
Upvote 0
if you need to switch between userforms....

Assuming that you are on userform2 and you want to show userform1 then
- Add a command button on userform2
- doubleclick on the command button and type
UserForm2.Hide
UserForm1.Show
'to hide your current form and show you the previous

and so on.....

hope this helps
 
Upvote 0
It sounds like you need to add a Scroll Bar.

Check out the VBA Help file for some examples.

I'd be happy to e-mail you an example if you like. Just pm me your e-mail address.

Hope that helps,

Smitty
 
Upvote 0
:confused: OK, you have lost me.

On my present userform, I have a command button for OK, one for Cancel, one for Print form, and one for clear form.

I just want to insert one for previous record and one for next record so I have the ability to look through all of the records via the user form or in case changes are made and I have to print a new form.
 
Upvote 0
I'd suggest you pase the code for your OK button here so we can get a better idea of what it does. A "record" could be one cell or 100 cells. The information from your userform could be placed on one sheet or multiple sheets.

I'm sure your request is attainable but more information is needed to determine what you want done.
 
Upvote 0
Private Sub CmdOK_Click()

ActiveWorkbook.Sheets("Active Employees").Activate
Range("A2").Select
Do

If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If

The above is the code that I have for my "ok" button.
I have created an employee spreadsheet using a userform. The userform puts the information on my "Active Employees" worksheet. The spreadsheet has around 33 columns. Each row is an employee record containing all of their information. Because of the high "turn around" we have w/ employees, once I enter a date into my "release date" column, that row (or record) gets moved from my "Active Employees" worksheet to my "Inactive Employees" worksheet.

I hope this added info helps.
 
Upvote 0

Forum statistics

Threads
1,213,514
Messages
6,114,078
Members
448,547
Latest member
arndtea

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top