AfterUpdate Event Help needed

fastmike

Registered User.
Local time
Today, 13:24
Joined
Jun 9, 2006
Messages
61
Hi. i am very thankful for all your help in my other queries for my database. i have one last question and i guess i will be done after that. i have a form which have 3 fields one is Number and the other is group and the next one is Account. all of them are combo boxes. I am trying to add this function in the Number field text box properties in afterupdate event which is as follow

Sub Number_Afterupdate()
If not isnull(Number) Then
Number=Format(Number, "000000")
Endif
End sub

The code is working fine. i debug it and run it no errors. i want to put this function in afterupdate. i copied this whole thing in the afterupdate box and when i go back to my control form try to enter numbers in the Number field it gives me this

Msaccess can't find the macro "private sub Mynumber" the macro or its macrogroup does not exist or the macro is new but has'nt been saved.

Can anyone help me out what i am doing wrong ? or can tell me steps what to do i really appreciate that and thanks alot FONZ :)
 
One of your events has =private sub Mynumber when it probably should have [Event Procedure]
 
Sorry i am a newbie. where am i suppose to type that Event Procedure.?
 
If you press the builder button "..." and select code builder, Access will put it in for you.
 
i did the same thing clicked on ... build sign and code builder and this is what i wrote

Private Sub Number_AfterUpdate()
If Not IsNull(Number) Then
' this will format the number with leading zeros upto a length of 6,
' increase the no of zeros to increase the size of the number
Number = Format(Number, "000000")
End If
End Sub

and i clikced on EVent Procedure on the after update still not doing wat is suppose to do.
 
hey guys. sorry to interrupt you. i was wondering if there is a way to put some kind of freeze on a column?. like for instance we have a column by the name of (INVESTORS). and we already have 200 data already entered. but for some reason company wants to create something else which i have already taken care of it. all i want to know is if there is any function or procedure or anything that everyone can see the previous records in that column but wont be able to enter any more data since we need the previous record. anyone able to help ?
Thanks
 
Your users should *only* be able to view/edit your tables in forms you provide. You can do any limiting you want in a form.
 
You can set Allow Additions to No, Allow Edits to No, Allow Deletions to No etc. You could also keep a recordset limited to 200 records if you wanted to.
 
hmmm superb thanks rural guy i willl go to my office tomorrow and implent. works fine for me on a dummy database i appreciate that.
 

Users who are viewing this thread

Back
Top Bottom