![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
When I click the Command Button to open a form I receive the error: Object Reuired. This form is a subform connected to a main form. Any suggestions? Thanks! Zuf Here is the code behind the Command Button: Private Sub Command108_Click() On Error GoTo Err_Command108_Click Dim stDocName As String Dim stLinkCriteria As String 'you could enter debug moder here to find out what line blows up by entering |
|
stDocName = "frmQuery5" ' stLinkCriteria = "[CallDate] Between [Forms]![Main]![Child89]. [Form]![txtBeginQAEvry5th] And [Forms]![Main]![Child89].[Form]! [txtEndQAStopEvry5th]" stLinkCriteria = "[CallDate] Between #" & txtBeginQAEvry5th.Value & "# and #" & txtEndQAStopEvry5th.Value & "#" 'you might want to know what's in this variable |
|
DoCmd.OPENFORM stDocName, acNormal, , stLinkCriteria, acFormEdit Exit_Command108_Click: Exit Sub Err_Command108_Click: MsgBox Err.Description Resume Exit_Command108_Click End Sub |
#3
| |||
| |||
|
|
zufie wrote: When I click the Command Button to open a form I receive the error: Object Reuired. This form is a subform connected to a main form. Any suggestions? Thanks! Zuf Here is the code behind the Command Button: Private Sub Command108_Click() On Error GoTo Err_Command108_Click * * Dim stDocName As String * * Dim stLinkCriteria As String 'you could enter debug moder here to find out what line blows up by entering * * * * STOP 'to step thru abd learn what line causes the error.> * * stDocName = "frmQuery5" ' * *stLinkCriteria = "[CallDate] Between [Forms]![Main]![Child89]. [Form]![txtBeginQAEvry5th] And [Forms]![Main]![Child89].[Form]! [txtEndQAStopEvry5th]" * * stLinkCriteria = "[CallDate] Between #" & txtBeginQAEvry5th.Value & "# and #" & txtEndQAStopEvry5th.Value & "#" 'you might want to know what's in this variable * * * * MSGBOX stLinkCriteria * * DoCmd.OPENFORM stDocName, acNormal, , stLinkCriteria, acFormEdit Exit_Command108_Click: * * Exit Sub Err_Command108_Click: * * MsgBox Err.Description * * Resume Exit_Command108_Click End Sub- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
On Jul 27, 11:35 am, Salad <o... (AT) vinegar (DOT) com> wrote: zufie wrote: When I click the Command Button to open a form I receive the error: Object Reuired. This form is a subform connected to a main form. Any suggestions? Thanks! Zuf Here is the code behind the Command Button: Private Sub Command108_Click() On Error GoTo Err_Command108_Click Dim stDocName As String Dim stLinkCriteria As String 'you could enter debug moder here to find out what line blows up by entering STOP 'to step thru abd learn what line causes the error.> stDocName = "frmQuery5" ' stLinkCriteria = "[CallDate] Between [Forms]![Main]![Child89]. [Form]![txtBeginQAEvry5th] And [Forms]![Main]![Child89].[Form]! [txtEndQAStopEvry5th]" stLinkCriteria = "[CallDate] Between #" & txtBeginQAEvry5th.Value & "# and #" & txtEndQAStopEvry5th.Value & "#" 'you might want to know what's in this variable MSGBOX stLinkCriteria DoCmd.OPENFORM stDocName, acNormal, , stLinkCriteria, acFormEdit Exit_Command108_Click: Exit Sub Err_Command108_Click: MsgBox Err.Description Resume Exit_Command108_Click End Sub- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - Here's how my code looks after I changed it: I get a Syntax error regarding the line: stLinkCriteria = "[CallDate] Between "#" & Any ideas? Thanks, Zufie Private Sub Command108_Click() On Error GoTo Err_Command108_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmQuery5" stLinkCriteria = "[CallDate]Between "#" & [Forms]![Main]![Child89].[Form]![txtBeginQAEvry5th] = "#" And "#" & "" [Forms]![Main]![Child89].[Form]![txtEndQAStopEvry5th] = "#" Debug.Print stLinkCriteria Stop DoCmd.OPENFORM stDocName, acNormal, , stLinkCriteria, acFormEdit Exit_Command108_Click: Exit Sub Err_Command108_Click: MsgBox Err.Description Resume Exit_Command108_Click End Sub |
![]() |
| Thread Tools | |
| Display Modes | |
| |