On my RegForClassSignIn form, the startdate, enddate, controls all have a date in them. Our related table requires it. This is fine because we never want those left blank. But now we have a situation where we don't want the date to show up on the ReceiptSignIn report (which shows up when Registercmd is clicked). So I want to add code to the Registercmd's "subprint receipt" that says something this:
If RegForClassSignIn (form where Register cmd resides).lstprogram = membership
Then ReceiptSignIn (that's the report) fields: startdate and enddate.visible = false
End if
But I don't know the language.
And I don't know where to put it in the print receipt sub.
Here's what's already there:
Thanks for your help!
~Dori
If RegForClassSignIn (form where Register cmd resides).lstprogram = membership
Then ReceiptSignIn (that's the report) fields: startdate and enddate.visible = false
End if
But I don't know the language.
And I don't know where to put it in the print receipt sub.
Here's what's already there:
Code:
Public Sub subPrintReceipt()
Dim response As Integer
Dim stDocName As String
Dim qdfTemp As QueryDef
Set db = CurrentDb
'----------------------------------------------
' Print Receipt
'----------------------------------------------
response = MsgBox("Registration Complete... Want to print Receipt?", vbYesNo)
If response = 6 Then ' yes
DoCmd.DeleteObject acQuery, "qryreceipt"
'Set qdfTemp = db.CreateQueryDef("qryReceipt", _
'"SELECT Members.LastName, Members.FirstName, Members.Address, Members.City, Members.State, Members.Zip, Members.Birthdate, MemClasses.ClassID, MemClasses.ClassDesc, memclasses.SubDesc, MemClasses.MemberID, MemClasses.CategoryID, MemClasses.StartDate, MemClasses.EndDate, MemClasses.LocID, MemClasses.Maximum, MemClasses.CurEnrollment, MemClasses.DatePaid, MemClasses.MemFee, MemClasses.PgmFee, MemClasses.TeamFee, MemClasses.Amount, MemClasses.Checknum, MemClasses.Cash, MemClasses.mon, MemClasses.tue, MemClasses.wed, MemClasses.thu, MemClasses.fri, MemClasses.sat, MemClasses.sun, MemClasses.Cash, MemClasses.CCamt, MemClasses.Ckamt, MemClasses.Certamt, MemClasses.Slipamt, MemClasses.Cashamt, MemClasses.CSlip, MemClasses.GiftCert, MemClasses.CCard, MemClasses.Cash, MemClasses.Check, MemClasses.Waiver, MemClasses.StartDate, MemClasses.EndDate, MemClasses.MemNotes FROM Members INNER JOIN MemClasses ON Members.MemberID = MemClasses.MemberID " & _
'"WHERE MemClasses.DatePaid=[forms]![regforclasssignin]![txtdatepaid] OR MemClasses.ClassID=[forms]![regforclasssignin]![classid] AND MemClasses.MemberID=[forms]![regforclasssignin]![memberid]")
Set qdfTemp = db.CreateQueryDef("qryReceipt", _
"SELECT initials.initials, Members.LastName, Members.FirstName, Members.Address, Members.City, Members.State, Members.Zip, Members.Birthdate, MemClasses.ClassID, MemClasses.ClassDesc, memclasses.SubDesc, MemClasses.MemberID, MemClasses.CategoryID, MemClasses.StartDate, MemClasses.EndDate, MemClasses.LocID, MemClasses.Maximum, MemClasses.CurEnrollment, MemClasses.DatePaid, MemClasses.MemFee, MemClasses.PgmFee, MemClasses.TeamFee, MemClasses.Amount, MemClasses.Checknum, MemClasses.Cash, MemClasses.mon, MemClasses.tue, MemClasses.wed, MemClasses.thu, MemClasses.fri, MemClasses.sat, MemClasses.sun, MemClasses.Cash, MemClasses.CCamt, MemClasses.Ckamt, MemClasses.Certamt, MemClasses.Slipamt, MemClasses.Cashamt, MemClasses.CSlip, MemClasses.GiftCert, MemClasses.CCard, MemClasses.Cash, MemClasses.Check, MemClasses.Waiver, MemClasses.StartDate, memclasses.monthly, MemClasses.EndDate, MemClasses.MemNotes " & _
"FROM (Members INNER JOIN MemClasses ON Members.MemberID = MemClasses.MemberID) LEFT JOIN Initials ON MemClasses.IDinitials = Initials.IDinitials " & _
"WHERE MemClasses.DatePaid=[forms]![regforclasssignin]![txtdatepaid] OR MemClasses.ClassID=[forms]![regforclasssignin]![classid] AND MemClasses.MemberID=[forms]![regforclasssignin]![memberid]")
'FROM (Members INNER JOIN MemClasses ON Members.MemberID = MemClasses.MemberID) LEFT JOIN Initials ON MemClasses.IDinitials = Initials.IDinitials
DoCmd.OpenReport "receiptSignin", acPreview, , _
"[memberid] = forms![RegForClassSignin]!txtid and [datepaid] = forms![regforclasssignin]!txtdatepaid"
End If
End Sub
Thanks for your help!
~Dori