selenau837
Can still see y'all......
- Local time
- Today, 06:41
- Joined
- Aug 26, 2005
- Messages
- 2,211
mogul0212 said:What don't you see?
I do not see the forms you are refering too with that code?
mogul0212 said:What don't you see?
mogul0212 said:The form I have the OnClick action with that code in it is named Search-Tooling
I belive that is where it goes. You did say a module, but my newbie side know very little about the difference between putting the code in a module or having a "OnClick" event button.
mogul0212 said:Hey, you're helping me out. I'll never complain when I'm getting help. Besides, my newbie questions are probably a cause of your headache.
Search-Tooling is the name of the form that has "refresh", "run maco" and "view form" button on it. The "refresh" and "run macro" buttons were just to make testing results easier for me originally. I had them made when I noticed I couldn't leave one of the above drop down menus blank. The "view form" button was an attempt to try take the code you gave me and get results in a form, granted, I'm clueless on all this so I'm sure I don't have it done right.
Ideally, want a button to refresh the data in the query and then a button to open a form that displays the results of that search while allowing some of the criteria in the Search-Tooling form to be blank. And if they are left blank it doesn't return all records in the table, but treats that blank criteria box as a "boolean" type search saying that any item in that field is ok for search criteria. Does that make sense?
Private Sub Command15_Click()
Dim strFilter As String
Dim strFormName As String
strFormName = "result-Tooling"
If IsNull([COLOR="Red"]Me.cmbNCTool.Value[/COLOR]) = False Then
strFilter = strFilter & _
"[result-Tooling]![txtTool].Value = " & [COLOR="red"]Me.cmbNCTool[/COLOR].Value
End If
If IsNull([COLOR="red"]Me.cmbNCDivision.Value[/COLOR]) = False Then
If IsNull([COLOR="red"]Me.cmbNCTool.Value[/COLOR]) = False Then
strFilter = strFilter & " And "
End If
strFilter = strFilter & _
"txtNCDivision.value = '" & [COLOR="red"]Me.cmbNCDivision[/COLOR].Value & "'"
End If
If IsNull([COLOR="red"]Me.cmbToolMaterial.Value[/COLOR]) = False Then
If IsNull([COLOR="red"]Me.cmbNCTool.Value[/COLOR]) = False Or _
IsNull([COLOR="red"]Me.cmbNCDivision.Value[/COLOR]) = False Then
strFilter = strFilter & " And "
End If
strFilter = strFilter & _
"txtToolMaterial.value = '" & Me.[COLOR="red"]cmbToolMaterial.Value [/COLOR]& "'"
End If
DoCmd.OpenForm strFormName, , , strFilter
End Sub
mogul0212 said:Heck, You've helped me do so much already. NO need to apologize.
You know someone that can help to populate to a form? Or do I need to try posting another thread asking how?
mogul0212 said:Quick question...
Do I change the name of the field in just the form, or do Ineed to change the name of the field in the original table?
mogul0212 said:Yup, I copied and pasted what you had posted.
Just trying to change the combo box name in properties, (the very top entry in the properties dialog box)