Need help with my code...

euniceee

New member
Local time
Today, 17:08
Joined
Feb 7, 2006
Messages
7
Hey yaa I am currently doing my A2 Computing project and I juz a beginner in programming, can someone tell me how come this code is not working? thzzz=)

Private Sub Form_Current()


If txtCount.Value >= 3 Then

MsgBox ("You have entered more than 3 Open Days Details!")
SubForm.Locked = "YES"
SubForm.AllowEdits = "NO"
Else

End If

End Sub

It said sth object required in the error window
 
It's hard to be sure without seeing the form, but here are two things you could try to remove that error

Where it says

SubForm.Locked = "YES"
SubForm.AllowEdits = "NO"
try
me.form.locked= true
me.form.allowedits = false

good luck
Dan
 
What's txtCount, is it a textbox where somebody enters a figure, or is it the nimber of records displayed?
 
DanR said:
It's hard to be sure without seeing the form, but here are two things you could try to remove that error

Where it says


try
me.form.locked= true
me.form.allowedits = false

good luck
Dan
thz alot! I have changed it, but this time there is another error msg saying "Application defined or object defined error".=) What's the meaning of the syntax "ME" means?
 
Rich said:
What's txtCount, is it a textbox where somebody enters a figure, or is it the nimber of records displayed?
txtCount is the name of the textbox and it counts the number of records. =)
 
I'd rather use the RecordsetClone method but something like
If Me!txtCount >= 3 Then
Me.SubFormContrName.Locked = True
Else etc
 
Rich said:
I'd rather use the RecordsetClone method but something like
If Me!txtCount >= 3 Then
Me.SubFormContrName.Locked = True
Else etc
hurray=) it works now!! thzz alot!
 

Users who are viewing this thread

Back
Top Bottom