I am having issues transferring records using VB (actually, SQL) because of Null values within some of the record fields:
Lets say I have a record that has 5 fields. The first 2 are part of the primary key, the other three are just descriptive fields.
Within VB code, I create a string variable and to it I associate something like
"INSERT into <table> (list 5 fields) values (<v1>, <v2>, <v3>, <v4>, <v5>)"
The variables are taken from fields on the form, OR a coded, determined recordset.
The problem is that some of the fields MIGHT be Null. If they are, then when I use the string and execute the following:
DoCmd. RunSQL <sql string>
I get an error, because of the Null. If no Nulls exist, I don't get an error and it properly inserts the record.
Thanks for help on this,
- arm1
Lets say I have a record that has 5 fields. The first 2 are part of the primary key, the other three are just descriptive fields.
Within VB code, I create a string variable and to it I associate something like
"INSERT into <table> (list 5 fields) values (<v1>, <v2>, <v3>, <v4>, <v5>)"
The variables are taken from fields on the form, OR a coded, determined recordset.
The problem is that some of the fields MIGHT be Null. If they are, then when I use the string and execute the following:
DoCmd. RunSQL <sql string>
I get an error, because of the Null. If no Nulls exist, I don't get an error and it properly inserts the record.
Thanks for help on this,
- arm1