I have a form that demands an input mask for a text box. The text box has a mask of three numbers then a space a dash another space and three more numbers.
This mask repeats itself upto a max of 4 times. ie
Auto id = 5 (679 - 574 - 678 - 571)
This data is stored in a table like:
AlertBaseTable
Auto Id Tankers
5 679574678571
What I want to do is store that data into a table that separates out the data into groups of three all related to the records auto id.
AlertBaseTanker Table
Auto Id Tankers
5 679
5 574
5 678
5 571
I then need to pull the data out of the tables I just inserted it into and concatenate them with each other placing a dash in between them for a report.
CombinedValuesT able
Auto Id Tankers
5 679 - 574 - 678 - 571
The code I have in place traces through perfect, but when it comes time for my SQL statement to fire it reads it and does nothing.
I will start with posting just my SQL statement as my code is quite large.
'Insert's Record into AlertBaseTanker
sSQL = "INSERT INTO AlertBaseTanker (AlertBaseID, AirTankerID) "
sSQL = sSQL & "VALUES ('" & strColumn1 & "', '" & Tanker & "')"
DoCmd.RunSQL (sSQL), dbonfailerror
One other question... When I execute an insert statement in VBA does it enter the data into the table immediately after leaving the execute statement.
What I need to now is if I can then query the table that I inserted values into later in the same sub.
The data integrity of my entire database relies on this bit of code and I have been struggling with it for weeks
Any help or insight will be greatly appreciated.
This mask repeats itself upto a max of 4 times. ie
Auto id = 5 (679 - 574 - 678 - 571)
This data is stored in a table like:
AlertBaseTable
Auto Id Tankers
5 679574678571
What I want to do is store that data into a table that separates out the data into groups of three all related to the records auto id.
AlertBaseTanker Table
Auto Id Tankers
5 679
5 574
5 678
5 571
I then need to pull the data out of the tables I just inserted it into and concatenate them with each other placing a dash in between them for a report.
CombinedValuesT able
Auto Id Tankers
5 679 - 574 - 678 - 571
The code I have in place traces through perfect, but when it comes time for my SQL statement to fire it reads it and does nothing.
I will start with posting just my SQL statement as my code is quite large.
'Insert's Record into AlertBaseTanker
sSQL = "INSERT INTO AlertBaseTanker (AlertBaseID, AirTankerID) "
sSQL = sSQL & "VALUES ('" & strColumn1 & "', '" & Tanker & "')"
DoCmd.RunSQL (sSQL), dbonfailerror
One other question... When I execute an insert statement in VBA does it enter the data into the table immediately after leaving the execute statement.
What I need to now is if I can then query the table that I inserted values into later in the same sub.
The data integrity of my entire database relies on this bit of code and I have been struggling with it for weeks
Any help or insight will be greatly appreciated.
Comment