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

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

TryingToLearn

Well-known Member
Joined
Sep 10, 2003
Messages
723
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?
 

phonio

New Member
Joined
Feb 5, 2004
Messages
9
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
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
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
 

Bcarter

New Member
Joined
Dec 19, 2003
Messages
8

ADVERTISEMENT

: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.
 

TryingToLearn

Well-known Member
Joined
Sep 10, 2003
Messages
723
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.
 

Bcarter

New Member
Joined
Dec 19, 2003
Messages
8

ADVERTISEMENT

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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,876
Messages
5,766,875
Members
425,383
Latest member
IllDo

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
Top