hide rent number

TimjHebert

Registered User.
Local time
Today, 15:55
Joined
Dec 12, 2004
Messages
40
i have a database i called rent. It has one field in the table called rentnumber. i have made a form called rent with a button to insert the next rental number. this is my code to generate the next number.

Private Sub Command4_Click()
Me![rentnumber] = DMax("[rentnumber]", "[tblrent]") + 1
End Sub

The only problem i see is that the previous number shows before i generate the new one. is there any way to hide the previous number before i generate the new one.
 
Hide

Is this a Single form?

You could hide the field when the form opens by putting this code in the ON Open Event of the form:

Me.Rentnumber.Visible = False

And after generating the new number:

Me.Rentnumber.Visible = True

I'm not sure if this would be a good solution though, depends on what your form is like.
 
i dont think he wants to hide the field after its inputted... why you dont just go to a new record...

docmd.gotorecord,,acnew
 

Users who are viewing this thread

Back
Top Bottom