Ms Access Beginner - Need Help

qiqinuinaifen128

Registered User.
Local time
Today, 02:54
Joined
Dec 21, 2008
Messages
29
Hi all,
I'm a beginner in Access. i hope i can get some advices here.

I have a Form Database.

There are several field in my database.
1.InstructorName <textbox1>
2.InstructorNumber <textbox2>
3.Fees <textbox3>

I decide to add a button and a label/textbox into my database and the label/textbox will display below message after i click the button.

CONFIRMATION
Instructor: <InstructorName> <InstructorNumber>
1st lesson on 2 Jan and every Friday 4.30pm @ ABC Swimming Complex.
Fee: <Fees> per month per student
You may make your first payment by bank/internet transfer to UOB current 123-456-789 or DBS Current 123-456-789 within 3 days to confirm your slot. Kindly update us upon successful transaction for verification purpose.
Many thanks!

The red color text is the test that from the database

How should i write the command into my button?

Thank you in advance
 
First you need to check to make sure that all your required data (Instructor Name, ID and Fees) has been entered and if not, warn your user and stop the process. If all data is there, then change caption on your label. Since you have to have acaption when you create a label, I used "Confirmation Notice." So when the record first appears, that's what the label says. After the data is entered and the button pressed, it shows the actual confirmation message.

Code:
Private Sub YourCommandButton_Click()
If IsNull(Me.Textbox1) Or IsNull(Me.TextBox2) Or IsNull(Me.TextBox3) Then
  MsgBox "Instructor's Name, ID Number and Fees must be filled in!"
  Exit Sub
Else
  Me.ConfirmationLabel.Caption = "CONFIRMATION" & vbNewLine & _
  "Instructor: " & Me.Textbox1 & " " & Me.TextBox2 & vbNewLine & _
  "1st lesson on 2 Jan and every Friday 4.30pm @ ABC Swimming Complex. Fee: " & _
  Me.TextBox3 & " per month per student" & vbNewLine & _
  "You may make your first payment by bank/internet transfer to UOB current" & _
  "123-456-789 or DBS Current 123-456-789 within 3 days to confirm your slot." & _
  "Kindly update us upon successful transaction for verification purpose." & vbNewLine & _
  "Many thanks!"
End If
End Sub
 
Thank you for your reply.

It's really solve my problem and add one more checking for my database. It's really powerful. I would appreciate you help.

Are vbCrLf and vbNewLine the same? [FONT=&quot][/FONT]
 
Can help me for another question

Can i add another "if Else" in the command. We have two type of payment methods.

In my database there is a field for drop down list. It is for record how the student make the payment? There are two choices for them. First is Bank Transfer, Second is Cheque Payment.

How to write a the command regarding "bank transfer" is selected?


If (drop down list-Bank Transfer selected)
display the message about make the payment by Bank Transfer
Else
display the message about mail the cheque to office
End If
End Sub

Thank you in advance
 

Users who are viewing this thread

Back
Top Bottom