add Button oblem.

sahh1419

Registered User.
Local time
Today, 09:05
Joined
Dec 27, 2012
Messages
29
i have 40 records of Student. i want to insert diffrent mobile no against the same [GR No].
-----------------------------------------------------------------------
Record in Table Data:
.[GR No] [Name] [Class] [Mobile]
1 AfeefuD-Din Nursery +9235694444
2 Aslam Nursery +9233333333
3 Mahnoor Play +9212111111
4 Shazia Prep +9233333322
5 Janet One +9212333655

-----------------------------------------------------------------------
Code::::
Private Sub Add_Record1_Click()
On Error GoTo ErrorHandler
DoCmd.SetWarnings False
Dim StrSQl As String
If [E] = "English" Then
Me.TT = DLookup("Mobile", "Student", "[GR No]" = "[GR No]")
tn = DLookup("Name", "Student", "[GR No]" = "[GR No]")
StrSQl = "Insert into MsgOut (iid,msg,send,msgto) values([GR No],'Respected Parents!' & TN & ' has Secure ' & [1] & ' Marks Out of ' & [1t] & '.Marks Percentage: ' & Round(Percentage*100,2) & ' in English. :: Kids Campus.','Yes',tt);"
DoCmd.RunSQL (StrSQl)
DoCmd.GoToRecord , , acNewRec

-----------------------------------------------------------------------
It will works fine but the mobile and name of students is the same for each student. please see the attched file. in this [GR No] is diffrent and mobile and name is the same....i want to diffrent gr no, mobile and name with same gr no.
pls review the code and advised me.
 

Attachments

  • 2.JPG
    2.JPG
    48 KB · Views: 137

Users who are viewing this thread

Back
Top Bottom