M
Marie203
I am having a problem getting my Access database search results to open in a
form. When I first open the database, a switchboard opens that will allow
the user to add an entry to the database, search the database, and exit the
database. The search button opens a search form that has three buttons:
Clear field(s) (Command15), Search DB (Command16), & Close Search Form
(Command17). The Clear Field(s) button and the Close Search Form button work,
but the Search DB button doesn’t work like I want it to. It performs the
keyword search correctly, but the results show in a datasheet. I want each
record to show in a separate form after the search rather than a datasheet
because of the amount and kind of information. I am not really familiar with
writing code, but I have tried to use examples that I have found on the
Internet. I have spent many hours trying to figure this out, but I can’t. I
know this command is a problem: DoCmd.OpenQuery "helpquery", acViewNormal
but I don't know what it should be. Please help. The form that has all of
the database records is called HELP_FRM. The code is below.
Option Compare Database
Private Sub Label9_Click()
Me.qtype1.Value = ""
Me.qtopic1.Value = ""
Me.qdescrip1.Value = ""
End Sub
Private Sub Command12_Click()
On Error GoTo Err_Command12_Click
Screen.PreviousControl.SetFocus
DoCmd.FindNext
Exit_Command12_Click:
Exit Sub
Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
End Sub
Private Sub CParam_Click()
On Error GoTo Err_CParam_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_CParam_Click:
Exit Sub
Err_CParam_Click:
MsgBox Err.Description
Resume Exit_CParam_Click
End Sub
Private Sub RQuery_Click()
On Error GoTo Err_RQuery_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
Exit_RQuery_Click:
Exit Sub
Err_RQuery_Click:
MsgBox Err.Description
Resume Exit_RQuery_Click
End Sub
Private Sub Command15_Click()
Me.qtype1.Value = ""
Me.qtopic1.Value = ""
Me.qdescrip1.Value = ""
End Sub
Private Sub Command16_Click()
DoCmd.OpenQuery "helpquery", acViewNormal
End Sub
Private Sub Command17_Click()
On Error GoTo Err_Command17_Click
DoCmd.Close
Exit_Command17_Click:
Exit Sub
Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click
End Sub
form. When I first open the database, a switchboard opens that will allow
the user to add an entry to the database, search the database, and exit the
database. The search button opens a search form that has three buttons:
Clear field(s) (Command15), Search DB (Command16), & Close Search Form
(Command17). The Clear Field(s) button and the Close Search Form button work,
but the Search DB button doesn’t work like I want it to. It performs the
keyword search correctly, but the results show in a datasheet. I want each
record to show in a separate form after the search rather than a datasheet
because of the amount and kind of information. I am not really familiar with
writing code, but I have tried to use examples that I have found on the
Internet. I have spent many hours trying to figure this out, but I can’t. I
know this command is a problem: DoCmd.OpenQuery "helpquery", acViewNormal
but I don't know what it should be. Please help. The form that has all of
the database records is called HELP_FRM. The code is below.
Option Compare Database
Private Sub Label9_Click()
Me.qtype1.Value = ""
Me.qtopic1.Value = ""
Me.qdescrip1.Value = ""
End Sub
Private Sub Command12_Click()
On Error GoTo Err_Command12_Click
Screen.PreviousControl.SetFocus
DoCmd.FindNext
Exit_Command12_Click:
Exit Sub
Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
End Sub
Private Sub CParam_Click()
On Error GoTo Err_CParam_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_CParam_Click:
Exit Sub
Err_CParam_Click:
MsgBox Err.Description
Resume Exit_CParam_Click
End Sub
Private Sub RQuery_Click()
On Error GoTo Err_RQuery_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
Exit_RQuery_Click:
Exit Sub
Err_RQuery_Click:
MsgBox Err.Description
Resume Exit_RQuery_Click
End Sub
Private Sub Command15_Click()
Me.qtype1.Value = ""
Me.qtopic1.Value = ""
Me.qdescrip1.Value = ""
End Sub
Private Sub Command16_Click()
DoCmd.OpenQuery "helpquery", acViewNormal
End Sub
Private Sub Command17_Click()
On Error GoTo Err_Command17_Click
DoCmd.Close
Exit_Command17_Click:
Exit Sub
Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click
End Sub