Changing checkbox datatype in query for "make table" type query

drybone

Registered User.
Local time
Today, 05:18
Joined
Mar 31, 2015
Messages
29
Hello all,
I have a make table type query that runs from a button on a form.

The form is an unbound form that allows new users to provide their info to the admin to register an account.

So basically, when the user fills out the form, they click a button and it runs a "make table" type query. Every time the query is ran it overwrites the previous submission (which is what I want).

The problem I'm having is that it creates the table with all the field data types being binary.

This is an example of what I've written into the query fields so far:

Code:
TblFieldName: CStr([forms]![FrmUserRequest]![TxtbxUserName])

This works for the "date of submission" textbox and the "Username" textbox, but the rest of the fields the query pulls to the table are checkboxes. When the check boxes are dropped onto the table they are displayed as binary and show up as blank (if not checked) and as 2 boxed in question marks (if checked).

If I try to use CStr () for those fields in the query it gives me an error saying the expression is to complex to be evaluated.

Besides CStr() is there any other conversion function that I can use to accomplish this?

Thank you for any advice you can give.
 
Int() was my next guess but it changes the value from 2 question marks to -1.

is there a way to mask how it displays... ie:

IIf(
![tblfieldcheckbx]= "-1" , "Yes")

I don't know how to write that and my first stab was just as displayed above and that was a nogo.
 
Figured it out!

In case someone else runs into the same situation:

In the query field, to change the created tables checkbox field from binary to text and have it display Yes instead of "-1" I did this:

TblFieldName: IIf(Int([forms]![FrmUserRequest]![TxtbxUserName])= "-1","Yes",)

You put that into the Queries field name and it names that field "TblFieldName" and once the make table query runs it changes the Datatype to Text with the Int() and the IIf (...= "-1","Yes",) makes it display Yes instead of -1.
 

Users who are viewing this thread

Back
Top Bottom