cliffsimms
Registered User.
- Local time
- Today, 04:33
- Joined
- Sep 28, 2000
- Messages
- 18
am building a database for the first time with Access2000.
1) I would like to have a command button that would allow someone to type there name to locate their information, if they are not listed I would like a message to pop up that would tell them that they would need to enter their information on a different form which is already built.
I do not want to use the basic find record command button though. I have this mush of code done but it has a bug in it.
Option Compare Database
Option Explicit
Function OpenFormWithInput()
Dim Msg As String
Dim Title As String
Dim Defvalue As String
Dim Answer As String
Msg = "Enter Student Name"
Title = "OPEN CUSTOMERS FORM"
Defvalue = ""
Answer = InputBox(Msg, Title, Defvalue)
If Answer <> "" Then
DoCmd.OpenForm "frmStudent", , , "[NameID]='" & Answer & "' "
Else
DoCmd.OpenForm "frmstudent"
End If
End Function
Everything runs fine until this point and than I get a run error 2502 open form command has been canceled.
2) I would like to set a max number of seats available and have the seats subtract automatically as people register for a class. So when the next person try's to enter the same date for a class they will see that there are 10 or 9 seats left and so on.
3) I would like to have the of a class gray out and make it so that a person is unable to select it if the date has already past or the seats are filled.
1) I would like to have a command button that would allow someone to type there name to locate their information, if they are not listed I would like a message to pop up that would tell them that they would need to enter their information on a different form which is already built.
I do not want to use the basic find record command button though. I have this mush of code done but it has a bug in it.
Option Compare Database
Option Explicit
Function OpenFormWithInput()
Dim Msg As String
Dim Title As String
Dim Defvalue As String
Dim Answer As String
Msg = "Enter Student Name"
Title = "OPEN CUSTOMERS FORM"
Defvalue = ""
Answer = InputBox(Msg, Title, Defvalue)
If Answer <> "" Then
DoCmd.OpenForm "frmStudent", , , "[NameID]='" & Answer & "' "
Else
DoCmd.OpenForm "frmstudent"
End If
End Function
Everything runs fine until this point and than I get a run error 2502 open form command has been canceled.
2) I would like to set a max number of seats available and have the seats subtract automatically as people register for a class. So when the next person try's to enter the same date for a class they will see that there are 10 or 9 seats left and so on.
3) I would like to have the of a class gray out and make it so that a person is unable to select it if the date has already past or the seats are filled.