by defintion a text box control's data type is string / text. You can store other datatypes in that control, and you can coerce other datatypes by setting an input mask or formatting rule.
if you are altering a bound control then the input mask / validation rules applied are relevant to that underlying dtaa type in the database. From what you are saying I guess the problem is that the underlying datatype (from the table) and the formatting rule or input mask are in conflict.
The textbox will handle Date,Amount,and Text. 3 Types. Could you tell me?
do you mean a composite display of 3 items concurrently
selectign a differnet item depending on the values in the form
perhgaps if you could give an example of what you are trying to achieve, with some sample data.
Intrinsically a text box is always of type string, which is why you are usually reccomended to explcitily cast (convert) values from a control to a non string data type.
I open the "Input" form
there 2 textboxes
search1 => Field name from Table
value1 => value from the table depend on search1 name
it is a filter.
And, this form has "Input_sub" form, because I want to do filter.
// this case is work well
search1: Vendor Name
search1: Vendor Name
// This case is Not OK, has error
// this one is OK
// Do Again, Error come out
search1: Vendor Name
//Error message appear
"The value you entered isn't valid for this field, For Example, you may have entered text in a numeric field or a number that is larger than the Fieldsize setting permits"
Please give me the direction to solve this problem. I tried many ways, it still be there. I ever change the Datatype of date to be Text of the "Input" Table, then it works, but I want to use datatype of Date to be Date/Time.
It may be appropriate toi write a function to handle your formatting requirements
I'd suggest create a function in a code module
the prototype could be
public function formatmystring(curAmount as currency, datPaydate as datetime, strDesc as string)
if not isnull(curAmount) then formatmystring = formatmystring & format(curamount,"£#,##0.00p ") & ";"
if not isnull(datpaydate) then formatmystring = formatmystring & format(datpaydate,"dd-mmm-yyyy @ HH:MM") & ";"
if not isnull(strDesc) then formatmystring = formatmystring & strDesc
and then call that function in each contol you want to display the information set the value =formatmystring(var1,var2,var3)
Doesn't work. It's hard to solve that.
I think that I cannot solve this problem.
Anyway, thanks a lot. Thanks. Thanks.
My question is:
Date 8/31/2005 => do filter
Name Jimmy => Cannot do filter, Error message
Okay, you can try to do it in the table, create the new table, make one field to be Date (Date/Time), after that input the Character, the error message will come out, that message is what I said before. Now, I can set Text for Date, and then set Input Mask, but actually, I don't like it, because it fix the position, I want to set Date/Time, because it is automatic come out the date format if I just 8/31/05, it will come out 8/31/2005 automatically. And also, the if the Amount set Text, it doesn't have xx,xxx.xx, this format. There are too many problems since I make the filter which filter can search any field and any value. The datatype will change always. That's why I cannot solve. Anyway, thanks a lot. Thanks. Thanks.
var1 is the name of your currency field say called myCurVal
var2 is the name of your date field say called myDateVal
var3 is the name of your desc field say called myDescVal
so if you have all 3 fields
alternatively you could rewrite the function as:
public function formatmystring(objValue as variant, bytStyle as byte)
if bytStyle=1 and not isnull(curAmount) then formatmystring = formatmystring & format(curamount,"£#,##0.00p ") & ";"
if bytStyle=2 and not isnull(datpaydate) then formatmystring = formatmystring & format(datpaydate,"dd-mmm-yyyy @ HH:MM") & ";"
if bytStyle=3 and not isnull(strDesc) then formatmystring = formatmystring & strDesc
the advantage of this approach is that you can tell the fucntion what value you are formatting