Re: Avoid Creating Auto Number Field

From: Mike Thomas (mike_at_ease.com)
Date: 12/20/04


Date: Mon, 20 Dec 2004 12:09:08 -0500

Thanks Ken,

That works for the header record. Eventually I'll add a sub form for detail
records (it's a part receiving form), so I'll definitely need to use a temp
table there.

Mike Thomas

"Ken Warthen" <KenWarthen@discussions.microsoft.com> wrote in message
news:398CA433-9791-4FA8-895F-EB1654DDD31E@microsoft.com...
> Mike,
>
> Don't use a temp table. Put a command button on your unbound form and use
> the On Click event to validate the entered data and add it as a new
> record
> to your table. You can create variables for each of the fields on the
> form,
> validate the entered data and then add a new record to your table using
> the
> values of your variables.
>
> Ken
>
> "Mike Thomas" wrote:
>
>> I am working on an unbound form which has the sole purpose of adding
>> records. A temp table which matches the layout of the permanent table is
>> needed, so I've used the following code to make the table:
>>
>>
>> On Error Resume Next
>> CurrentDb.TableDefs.Delete "tt_rct"
>> On Error GoTo 0
>>
>> strSQL = "SELECT receipt.* INTO tt_rct " & _
>> " FROM receipt WHERE false;"
>> CurrentDb.Execute (strSQL)
>>
>>
>> I then add the record, do the edit, then insert the record into the
>> permanent table if all the data is valid.
>>
>> Problem is, there is an auto number ID field in the permanent table
>> [receipt] which is inherited by the temp table. Is there a way to avoid
>> having the auto number field designated as an auto number field in the
>> temp
>> table. (I can work aroung the auto number field, but am curious).
>>
>> Many thanks
>> Mike Thomas
>>
>>
>>


Loading