Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the format of a text box with an option group case

Status
Not open for further replies.

Krash878

Programmer
May 8, 2001
172
US
Hello,
I have a form that has a subform that are not really linked. It is kinda a search form that shows me what I need based on the criteria I assign. Please bare with me on my terms I am not always using the right ones.

Ok the main form has this 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

I have a subform on that form that has this code:

Private Sub Form_Current()
Me.Parent![txtSeqNo] = Me![SequenceNumber]
End Sub

Ok and the final part
I have a query set up for each of the respected cases.
In the criteria of each query I have the following code

Like "*" & [forms]![frmChargeBackSearch]![txtSearch] & "*"


This allows me to type a value into the txtsearch (textbox) and select the case that applies to the value and then the results are displayed in the subform.

The Problem:

One of the fields I need to search is a dollar amount. When I search for a dollar amount like 17.70 I get a null return. However if I search for 17.7 I get the correct return data in the subform.

I am looking for a way to change the format of the txtsearch to a currency format when the case 3 for amount is chosen. Also case 5 is a date field I would like to change the format to date for that selection.


Can this be done?

Thanks
Krash
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top