Form wont work

J

Jason Marino

I am trying to create a form where the user will put in their name in
the text box and when they click ok it will call their form up. Every
time i click ok i get the following error message.



The expression On Click you entered as the event property setting
produced the following error: Produce declaration does not match
description of event or procedure having the same name.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].

*There may have been an error evaluating the function, event, or macro.

Below is my code can somebody help thanks.

Private Sub Ok_Click(Form)


If UserName = "Chris" Then
Call Form_Chris
End If


End Sub


Private Sub UserName_AfterUpdate()
Dim UserName As String
UserName = "Chris"
UserName = "Justin"
UserName = "Cliff"
UserName = "Jason"
UserName = "Karen"
End Sub
 
A

Arvin Meyer [MVP]

Try using code like:

If Me.UserName = "Chris" Then
DoCmd.OpenForm "Form_Chris"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top