Greets,
I am wondering how I can go about creating a VBA procedure that will accept a parameter, provide that parameter to a query and then output to HTML a form based on that query.
The report "YourSelect ion" is created with a record source "Query1". Query1 will prompt the user to select a userID number and return a recordset of all records in the db with that ID. I want to be able to save that report as HTML without having to use the propmt.
Here's what I have so far, perhaps someone can help explain why it isn't working as I expected it to.
Two things are not working here. The first is that I still get prompted to provide the parameter to Query1. Second, no matter what the function always returns False. Though the second issue isn't really that big, if anyone has any ideas on that, I'd appreciate those as well.
Thanks a lot,
Jason
I am wondering how I can go about creating a VBA procedure that will accept a parameter, provide that parameter to a query and then output to HTML a form based on that query.
The report "YourSelect ion" is created with a record source "Query1". Query1 will prompt the user to select a userID number and return a recordset of all records in the db with that ID. I want to be able to save that report as HTML without having to use the propmt.
Here's what I have so far, perhaps someone can help explain why it isn't working as I expected it to.
Code:
Public Function Test(ByVal selection As Integer) As Boolean
Dim qdf As QueryDef
Set qdf = CurrentDb.QueryDefs("Query1")
qdf.Parameters(0) = selection
DoCmd.OutputTo acOutputReport, "YourSelection", _
acFormatHTML, "request.html"
qdf.Close
Set qdf = Nothing
ReturnTest = True
End Function
Thanks a lot,
Jason
Comment