How to specify the data type of a field in a make-table query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a new table, based on another table, with a boolean field
defaulted to "No". But when I use
NewField: CBool(No)
in my MakeTable query, Access creates a Numeric field instead of a Boolean
one. Can someone tell me out to fix this?
 
Apart from quick'n'dirty operations, the Make Table query is almost useless,
largely for the very reason you are struggling with.

Instead, create the table with the field names, types, indexes, and
validation that you want. Then use an Append query to add the records
instead of a Make Table. If you need to clear it out before adding the
records, this line of code will do it:
dbEngine(0)(0).Execute "DELETE FROM Table1;", dbFailOnError
 
From this distance, I have no idea where the code would go.

Presumably if you need to empty the table, and then execute an append query
statement, it would go into the same code/macro as whatever runs the append.
 
well you're not very smart after all are you ;) I only mock because I have
no code experience at all and use the design grid for all my queries.

I was trying to figure out where in the append query that code would go.
I just ended up making a delete qury and then put that qury and the append
qury into a macro and all works well.

Thanks
Laura
 
Back
Top