| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Using subform within a tabbed control
Please, I am trying to develop a form that has a tab control within it. one of the tab pages has a subform that is made visible when a user clicks on a search button. when a user clicks on the command button, the onclick event procedure is activated and the values from a combobox and textbox are used in executing a query which is used to set the recordsource property of the subform and displays the result.
I also needed to add additional tabs and the controls (textboxes) on those tabs and the main form retrieve their values from a field in one of the tables. I changed the recordsource property of the form to the table and my subform stopped working. the sourcecontrol property of the other fields are the names of the field within the table. Please can anyone help in solving this problem. 2. I also want to include a command button on my subform to move to the next record after the result of the query is displayed on the subform. 3. Please how can I reference the record count property from the result of the query. The code that is executed when the user clicks on the command button is shown below. Private Sub cmandSearch_Click() Dim GCriteria As String 'MsgBox (txtSearch) If Len(cboSearch) = 0 Or IsNull(cboSearch) = True Then MsgBox "You must select a field to search." ElseIf Len(textSearch) = 0 Or IsNull(textSearch) = True Then MsgBox "You must enter a search string." Else 'Generate search criteria GCriteria = cboSearch.Value & " LIKE '*" & textSearch & "*'" 'Filter Employees based on search criteria Forms!frmSearch2!frmMemberSearch.Form.RecordSource = "select * from Members_Details where " & GCriteria MsgBox (Forms!frmSearch2!frmMemberSearch.Form.RecordSourc e) textSearch = "" MsgBox "Results have been filtered." End If frmMemberSearch.Visible = True end sub |
![]() |
| Viewing: Tutorialized Forums > Databases > MS Access > Using subform within a tabbed control |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|