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
|
|||
|
|||
No Record Display after Click
In my form, "Form1" (which link to a query), there are 2 command buttons. 1
is to run the query and the other is to return to switchboard. When the query runs, it open another form, "Form2" (which display the filtered record which I entered in Form1), has 1 command button which closes Form2 (the active form) and return to Form1 for another new query. My problem now is whenever I'm back in Form1 to enter another new query, the result in Form2 is blank. Why is this? How could I overcome this issue? Here are the codes:- Form1’s (“Find Tender”) Query Parameters Name Type Forms![Find Tender]!Code Text Forms![Find Tender]!Part Text Forms![Find Tender]![GQ No] Text Code 1 VERSION 1.0 CLASS 2 BEGIN 3 MultiUse = -1 'True 4 END 5 Attribute VB_Name = "Form_Find Tender" 6 Attribute VB_GlobalNameSpace = False 7 Attribute VB_Creatable = True 8 Attribute VB_PredeclaredId = True 9 Attribute VB_Exposed = False 10 Option Compare Database 11 Option Explicit 12 13 Private Sub Command4_Click() 14 On Error GoTo Err_Command4_Click 15 16 Dim stDocName As String 17 Dim stLinkCriteria As String 18 Dim stLinkCriteria2 As String 19 20 stDocName = "Tender Record" 21 22 If IsNull([Part]) = True Then 23 stLinkCriteria = "[code]=" & "'" & Me![code] & "'And[Reg No]=" & "'" & Me![GQ No] & "'" 24 DoCmd.OpenForm stDocName, , , stLinkCriteria 25 Else 26 stLinkCriteria2 = "[code]=" & "'" & Me![code] & "'And[Reg No]=" & "'" & Me![GQ No] & "'And[Part]=" & "'" & Me![Part] & "'" 27 DoCmd.OpenForm stDocName, , , stLinkCriteria2 28 End If 29 30 Exit_Command4_Click: 31 Exit Sub 32 33 Err_Command4_Click: 34 MsgBox Err.Description 35 Resume Exit_Command4_Click 36 37 End Sub Form2’s (Tender Record) On Click - Macro: Close And Open (Original) Actions Name Condition Action Argument Value Close Object Type: Form Object Name: Tender Record Save: Prompt OpenForm Form Name: Find Tender View: Form Filter Name: Where Condition: Data Mode: -1 Window Mode: Normal SetValue Item: [Forms]![Find Tender]![code] Expression: “” SetValue Item: [Forms]![Find Tender]![GQ No] Expression: “” SetValue Item: [Forms]![Find Tender]![Part] Expression: “” GoToControl Control Name: Code Thank you for your assistance. Regards, Nora |
Thread Tools | |
Display Modes | |
|
|