Make Table Query

  • Thread starter Alastair MacFarlane
  • Start date
A

Alastair MacFarlane

Dear All,

If I am running a Mke Table query (INSERT .... INTO), how can I add another
field to the resulting table and set its datatype to TRUE/FALSE?

I know you cant say (Field:) Contact:"" and change the format to True/False,
but this does not seem to work because you are not changing the data type. Is
the only way to programatically open the table and alter its structure
through DAO?

Thanks again.

Alastair MacFarlane
 
V

Van T. Dinh

You can simply open the resultant Table in DesignView and add the Boolean
Field as required.

If you want to add the Boolean Field using the Make-Table Queryand assume
you want to insert False value, you can use something like

SELECT Field1, Field2, False As BoolField
INTO {NewTable}
FROM {Source}
 
A

Alastair MacFarlane

Sorry Van T. Dinh,

I am maybe missing something. What I am trying to do is create a table and
add a seperate column and make this field a True/False field that the user
will not access directly but through a form, therefore the process is:

Code executed which runs the query making the table with this Boolean field
that the user then selects on a form. All the True's will have something
happen to them.

Does what you are suggesting achieve the creating of a True/False Field that
the user has to either tick or un-tick ?

Thanks again.

Alastair
 
V

Van T. Dinh

Explain how you determine the value True or False for each Record created by
the Make-Table Query ...

Post details of your source Tables and the SQL String of your Make-Table
Query.
 
A

Alastair MacFarlane

Van T. Dinh,

Thanks for your continued support. The code I use at the moment is:

SELECT DISTINCT
Query1.Gross, Query1.MaxBookees, Query1.SalesInvoices.ID, "" AS Contact INTO
tblDailyNonAttendees IN 'K:\Attendees.mdb'
FROM Query1 LEFT JOIN qryAccessNLSubscriptionsL2b ON Query1.MemberID =
Query2.MemberID;

If I declare the field as: "" AS Contact, how can I ensure that when the
user sees the Contact field on the form what they see is the square box field
data type that they can tick. Is it only acheivable through DAO?

Thanks again for your continued support?

Alastair MacFarlane
 
V

Van T. Dinh

You can't do it that way since as soon as you use "", Access will assume it
to be a Text Field since "" is an empty String / empty Text value.

That's why I suggested False in my first reply.

The user see whichever Control you *decide* to place on the Form. The
CheckBox is a suitable Control but I have seen TextBox (formatted True/False
or Yes/No used as a Control bound to a Boolean Field.
 
Top