I'm so close I can TASTE IT! I'm working in Access 2003. I've read a bunch of posts, but still can't get to the bottom of this.
I have a "Selection Criteria" form (with Two free form Text Boxes Named Line_Num and Claim_Num).
Based on the entry in both fields, the users want to click on a button that launches and filters the returned results of the "Main form" by the Line and Claim numbers from the Selection Form. they want to be able to update data on the Main form when it launches.
I know the LinkCriteria is returning values (I put in a MsgBox at one point to see if that was the problem.. but it returned both values as part of the LinkCriteria string). I just keep getting "OpenForm action has been cancelled". I can't figure out what I'm doing wrong.
It works when I put the "DoCmd.OpenForm stDocName, , , stLinkCriteria" line in the Immediate window, so I know its something simple, but I just don't program enough to spot it.
The Main form has a recordsource of a query, the query references the Text Box input parameters (Text0 and Text2) from the "Selection Form"
I also tried using the main table (Drug_Util) as the "main form" record source. But got the same error.
ANY and all help is much appreciated.
Thank you so much, in Advance! :)
Expand|Select|Wrap|Line Numbers
- Private Sub CmdFormAdjustmentsForm_Click()
- On Error GoTo Err_CmdFormAdjustmentsForm_Click
- Dim stDocName As String
- Dim stLinkCriteria As String
- stDocName = "F_ADJ"
- stLinkCriteria = "[Line_Num]='" & Me![Text0] & "' AND [Claim_Num]='" & Me![Text2] & "'"
- DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
- DoCmd.Close F_AdjSelect