Hello everyone,
It seems I need help once again.
I have a form with a subform. On this form is a text box that is unbound called "txtSearch". This also has a frame group with 5 cases. Then there is a command button called "cmdSearch". The subform is linked to the main form by another textbox but that is unimportant to this problem.
The Subform is linked to queries. The query used is defined by the case form the frame group (I will show the code). Each query is then linked to the text box "txtSearch" with the following code in its respective search types criteria,
Like "*" & [forms]![frmChargeBackSearch]![txtSearch] & "*"
This code allows me to use a wild card in the form to get results.
The Command button has the following code
Private Sub cmdSearch_Click()
Select Case fraOptionGroup
Case 1
frmChargeBackSearchSubform.Form.RecordSource = "qrySeqSearch"
txtReturn = DCount("[SequenceNumber]", "qrySeqSearch" & " Record(s)"
Case 2
frmChargeBackSearchSubform.Form.RecordSource = "qryMIDSearch"
txtReturn = DCount("[SequenceNumber]", "qryMIDSearch" & " Record(s)"
Case 3
frmChargeBackSearchSubform.Form.RecordSource = "qryAmountSearch"
txtReturn = DCount("[SequenceNumber]", "qryAmountSearch" & " Record(s)"
Case 4
frmChargeBackSearchSubform.Form.RecordSource = "qryCCNoSearch"
txtReturn = DCount("[SequenceNumber]", "qryCCNoSearch" & " Record(s)"
Case 5
frmChargeBackSearchSubform.Form.RecordSource = "qryCloseDateSearch"
txtReturn = DCount("[SequenceNumber]", "qryCloseDateSearch" & " Record(s)"
End Select
End Sub
Ok all this works fine except for one thing.
When I chose case 3 which is for a dollar amount I do not get the result I want. I need to change the format to currency but only during case 3. Where do I need to set the format and what would it look like.
Thanks in advance to anyone that can help on this.
Kenny
It seems I need help once again.
I have a form with a subform. On this form is a text box that is unbound called "txtSearch". This also has a frame group with 5 cases. Then there is a command button called "cmdSearch". The subform is linked to the main form by another textbox but that is unimportant to this problem.
The Subform is linked to queries. The query used is defined by the case form the frame group (I will show the code). Each query is then linked to the text box "txtSearch" with the following code in its respective search types criteria,
Like "*" & [forms]![frmChargeBackSearch]![txtSearch] & "*"
This code allows me to use a wild card in the form to get results.
The Command button has the following code
Private Sub cmdSearch_Click()
Select Case fraOptionGroup
Case 1
frmChargeBackSearchSubform.Form.RecordSource = "qrySeqSearch"
txtReturn = DCount("[SequenceNumber]", "qrySeqSearch" & " Record(s)"
Case 2
frmChargeBackSearchSubform.Form.RecordSource = "qryMIDSearch"
txtReturn = DCount("[SequenceNumber]", "qryMIDSearch" & " Record(s)"
Case 3
frmChargeBackSearchSubform.Form.RecordSource = "qryAmountSearch"
txtReturn = DCount("[SequenceNumber]", "qryAmountSearch" & " Record(s)"
Case 4
frmChargeBackSearchSubform.Form.RecordSource = "qryCCNoSearch"
txtReturn = DCount("[SequenceNumber]", "qryCCNoSearch" & " Record(s)"
Case 5
frmChargeBackSearchSubform.Form.RecordSource = "qryCloseDateSearch"
txtReturn = DCount("[SequenceNumber]", "qryCloseDateSearch" & " Record(s)"
End Select
End Sub
Ok all this works fine except for one thing.
When I chose case 3 which is for a dollar amount I do not get the result I want. I need to change the format to currency but only during case 3. Where do I need to set the format and what would it look like.
Thanks in advance to anyone that can help on this.
Kenny