J
JonWayn
I have a procedure that takes SourceTableName, and DestTablename arguments
and creates a table matching the field structure of the table represented by
arg1. I use ALTER TABLE to add some standard fields to the destination table
if those fields didnt exist in the source table. After adding those fields, I
attempt to set the DefaultValue property of the new fields. I get the "Item
not found in collection" error and hovering over the elements of the
offending statement, I see that the offending object is the new field. If I
drag the execution mark up a few lines to the ALTER TABLE statement and
reexecute it, Access complains that the field does in fact exist. Is this a
bug in Access 2003, or am I doing something wrong here.
Also, if I had to set DefaultValues for a text field and a date field, which
has a formula, how do I code that with VBA? the Date field should have as a
DefaultValue, the following formula:
=IIf(Format(Date(),"h")>8,Date()+1,Date())
The text field has any standard string , eg. "Unk". What are the rules
governing the quoting of that string?
and creates a table matching the field structure of the table represented by
arg1. I use ALTER TABLE to add some standard fields to the destination table
if those fields didnt exist in the source table. After adding those fields, I
attempt to set the DefaultValue property of the new fields. I get the "Item
not found in collection" error and hovering over the elements of the
offending statement, I see that the offending object is the new field. If I
drag the execution mark up a few lines to the ALTER TABLE statement and
reexecute it, Access complains that the field does in fact exist. Is this a
bug in Access 2003, or am I doing something wrong here.
Also, if I had to set DefaultValues for a text field and a date field, which
has a formula, how do I code that with VBA? the Date field should have as a
DefaultValue, the following formula:
=IIf(Format(Date(),"h")>8,Date()+1,Date())
The text field has any standard string , eg. "Unk". What are the rules
governing the quoting of that string?