![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I see Type won't work. On a form that has textboxes, comboboxes, option groups, and the user can enter in dates, text, etc I don't see how I can tell what the user entered so I can build a query string. -paulw |
#3
| |||
| |||
|
|
PW wrote: Hi, I see Type won't work. On a form that has textboxes, comboboxes, option groups, and the user can enter in dates, text, etc I don't see how I can tell what the user entered so I can build a query string. -paulw What the user entered is not really relevant. The datatypes of the database fields are the determinging factor for the choice of delimiters you will use for your query string. What you need to do is validate that what the user entered in the textboxes is valid for the datatypes of the fields in which you are planning to store the data or that you intend to use to filter the results. |
|
Are you planning to loop through the textboxes? Are they unbound? Perhaps you can use the Tag property (does that still extist in whatever version of Access you are using?) to store the name of the database field they apply to if they are unbound. |
#4
| |||
| |||
|
|
On Wed, 6 Jul 2011 19:36:41 -0400, "Bob Barrows" reb01501 (AT) NOSPAMyahoo (DOT) com> wrote: PW wrote: Hi, I see Type won't work. On a form that has textboxes, comboboxes, option groups, and the user can enter in dates, text, etc I don't see how I can tell what the user entered so I can build a query string. -paulw What the user entered is not really relevant. The datatypes of the database fields are the determinging factor for the choice of delimiters you will use for your query string. What you need to do is validate that what the user entered in the textboxes is valid for the datatypes of the fields in which you are planning to store the data or that you intend to use to filter the results. Maybe I can write what the user selected to a table and then use the type property. Are you planning to loop through the textboxes? Are they unbound? Perhaps you can use the Tag property (does that still extist in whatever version of Access you are using?) to store the name of the database field they apply to if they are unbound. 2003. Is the tag property not available in 2010? If not, that might totally screw up my approach as I plan on upgrading to it! |
|
Unbound Bob. I got tired of Access automatically saving records (I think that was it. And other stuff maybe). And from various tables. They aren't all text boxes. But your intent is to associate them with database fields, correct?Use the |
#5
| |||
| |||
|
|
On Wed, 6 Jul 2011 19:36:41 -0400, "Bob Barrows" reb01501 (AT) NOSPAMyahoo (DOT) com> wrote: PW wrote: Hi, I see Type won't work. On a form that has textboxes, comboboxes, option groups, and the user can enter in dates, text, etc I don't see how I can tell what the user entered so I can build a query string. -paulw What the user entered is not really relevant. The datatypes of the database fields are the determinging factor for the choice of delimiters you will use for your query string. What you need to do is validate that what the user entered in the textboxes is valid for the datatypes of the fields in which you are planning to store the data or that you intend to use to filter the results. Maybe I can write what the user selected to a table and then use the type property. Are you planning to loop through the textboxes? Are they unbound? Perhaps you can use the Tag property (does that still extist in whatever version of Access you are using?) to store the name of the database field they apply to if they are unbound. 2003. Is the tag property not available in 2010? If not, that might totally screw up my approach as I plan on upgrading to it! Unbound Bob. I got tired of Access automatically saving records (I think that was it. And other stuff maybe). And from various tables. They aren't all text boxes. Thanks! |
#6
| |||
| |||
|
|
Hi, I see Type won't work. On a form that has textboxes, comboboxes, option groups, and the user can enter in dates, text, etc I don't see how I can tell what the user entered so I can build a query string. -paulw |
#7
| |||
| |||
|
|
Why the fixation on Controls in Forms -- they do not have a data type. If they are bound Controls, that is, with a Control Source that is, or derives from, a Field in a Table, that's where the data-type applies. And, that's what determines the structure of any Query that uses the values from the Form. If the Control on the Form is displaying a Field that contains a date value, SQL to use that date value in a Query would have to use paired #'s around the content of the Field, because it's comparing against a date value, not because of what the user typed into that Field on the Form. And, if the Form is unbound, or a Control is unbound, you are doomed to disappointment unless your users are far more consistent than most in typing in values without any mistakes. What are you trying to accomplish? |
|
We seem to have had a 'rash' of people who 'want' Forms to store/define data, lately, and on that assumption, tell us how they are trying to do something that does not work and want us to help them correct it. We usually can, but only after asking the proper questions and getting them answered. |
#8
| |||
| |||
|
|
PW wrote: On Wed, 6 Jul 2011 19:36:41 -0400, "Bob Barrows" reb01501 (AT) NOSPAMyahoo (DOT) com> wrote: PW wrote: Hi, I see Type won't work. On a form that has textboxes, comboboxes, option groups, and the user can enter in dates, text, etc I don't see how I can tell what the user entered so I can build a query string. -paulw What the user entered is not really relevant. The datatypes of the database fields are the determinging factor for the choice of delimiters you will use for your query string. What you need to do is validate that what the user entered in the textboxes is valid for the datatypes of the fields in which you are planning to store the data or that you intend to use to filter the results. Maybe I can write what the user selected to a table and then use the type property. Are you planning to loop through the textboxes? Are they unbound? Perhaps you can use the Tag property (does that still extist in whatever version of Access you are using?) to store the name of the database field they apply to if they are unbound. 2003. Is the tag property not available in 2010? If not, that might totally screw up my approach as I plan on upgrading to it! Don't know - sorry Unbound Bob. I got tired of Access automatically saving records (I think that was it. And other stuff maybe). And from various tables. They aren't all text boxes. But your intent is to associate them with database fields, correct?Use the control names to clue your code in, perhaps? |
#9
| |||
| |||
|
|
"PW" <emailaddyinsig (AT) ifIremember (DOT) com> wrote in message news:vak917hpgid37jel4ph0danh6tpn3n87qe (AT) 4ax (DOT) com... Hi, I see Type won't work. On a form that has textboxes, comboboxes, option groups, and the user can enter in dates, text, etc I don't see how I can tell what the user entered so I can build a query string. -paulw Try this: http://www.smccall.demon.co.uk/Forms.htm#CtlDataType HTH |
#10
| |||
| |||
|
|
2003. Is the tag property not available in 2010? If not, that might totally screw up my approach as I plan on upgrading to it! Don't know - sorry |
![]() |
| Thread Tools | |
| Display Modes | |
| |