Hello,
I am fairly new to VBA so I apologize in advance for my lack of knowledge. I've created several buttons to perform various things such as autofilling tables and printing records with certain where conditions so I thought this would be a simple thing to figure out in comparison but that is clearly not the case.
What I am trying to do is print a range of records between two manually inputted values (alphanumeric) that exist in a form. What I've done is created a form with 2 fields (Start and End) along with a button. I want the button to print all records between (and including) the start and end fields using a specific report. I wanted to use a simple where condition but am struggling with finding the correct command and syntax to do so. Any help would be much appreciated. I was thinking to do it with the statement below:
DoCmd.OpenReport "Shipping - Labels (Rack)", , , "[first rack #]" >= " & Me.Rack & " And "[last rack #]" <= " & Me.Rack & "
first rack # = start, last rack #=end, "Rack" is the field in the report that contains the data I want to filter.
I don't get an error using this command, however, all I get is a blank page. Is my logic at least close or am I completely in left field?
I am fairly new to VBA so I apologize in advance for my lack of knowledge. I've created several buttons to perform various things such as autofilling tables and printing records with certain where conditions so I thought this would be a simple thing to figure out in comparison but that is clearly not the case.
What I am trying to do is print a range of records between two manually inputted values (alphanumeric) that exist in a form. What I've done is created a form with 2 fields (Start and End) along with a button. I want the button to print all records between (and including) the start and end fields using a specific report. I wanted to use a simple where condition but am struggling with finding the correct command and syntax to do so. Any help would be much appreciated. I was thinking to do it with the statement below:
DoCmd.OpenReport "Shipping - Labels (Rack)", , , "[first rack #]" >= " & Me.Rack & " And "[last rack #]" <= " & Me.Rack & "
first rack # = start, last rack #=end, "Rack" is the field in the report that contains the data I want to filter.
I don't get an error using this command, however, all I get is a blank page. Is my logic at least close or am I completely in left field?