If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
stLinkCriteria
On my switchboard I have a command button that says
stDocName = "frmCertificationIssueDetail" stLinkCriteria = "[CallLogID]=" & Me![XXXXXX] DoCmd.OpenForm stDocName, , , stLinkCriteria [CallLogID] is a field on frmCertificationDetail. I want [XXXXXX] to pop up a parameter value. How do I need to adjust my code? |
#2
|
|||
|
|||
stLinkCriteria
One approach would be:
stLinkCriteria = "[CallLogID] = " & InputBox("What Call Log ID?") However, that isn't all that robust, as it won't handle the case where they change their mind and hit Cancel. Better might be Dim strLogId stDocName = "frmCertificationIssueDetail" strLogId = InputBox("What Call Log ID?") If Len(strLogId) 0 Then stLinkCriteria = "[CallLogID]=" & strLogId DoCmd.OpenForm stDocName, , , stLinkCriteria End If That assumes that CallLogID is a numeric field. If it's text, change the 4th line to stLinkCriteria = "[CallLogID]='" & strLogId & "'" Exagerated for clarity, that's stLinkCriteria = "[CallLogID]= ' " & strLogId & " ' " -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Pass-the-Reality" wrote in message news On my switchboard I have a command button that says stDocName = "frmCertificationIssueDetail" stLinkCriteria = "[CallLogID]=" & Me![XXXXXX] DoCmd.OpenForm stDocName, , , stLinkCriteria [CallLogID] is a field on frmCertificationDetail. I want [XXXXXX] to pop up a parameter value. How do I need to adjust my code? |
Thread Tools | |
Display Modes | |
|
|