Code help neede for gender report.

deanwat

New member
Local time
Today, 06:58
Joined
Nov 14, 2007
Messages
5
I am very new at this. So I'm sure I am far from right, so could some one help. I am trying to create a report that will ask weather you want a female or male report of customers through a input box. What I have is bellow:

Code:
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
   Dim strF As String
   Dim strM As String
   Dim strGender As String
   Dim intButtonPressed As Integer
   
   strGender = InputBox("Enter F for female repot and M for Male report.", 4, "Gender Report")
   
   If strGender = F Then
     DoCmd.ApplyFilter "SELECT * FROM tblCustomer WHERE Gender = 'F'"
      
   ElseIf strGender = M Then
      DoCmd.ApplyFilter "SELECT * FROM tblCustomer WHERE Gender = 'M'"
   End If
End Sub
 
Simple Software Solutions

Hi

You need to perform this on the OnLoad property of the form

Code Master::cool:
 

Users who are viewing this thread

Back
Top Bottom