Well, I use GetRecords to insert data into the database, but the RecordSet parameter to the function is not optional, so
I HAVE to create a new RecordSet(rlRecordSet) to throw to the function. But this is a convenient way of doing it. Suppose
I need the ID of the record I just entered into the database using strInsertRoute (and for a NotInList event, I assumed I needed it),
then all i have to do is set
Code:
ResultQuery = "SELECT @@Identity FROM ROUTE_NUMBER"
(as the function already does)
So now if I type
Code:
MsgBox rlRecordSet.Fields(0)
right after I call GetRecords function, it will prompt the ID of the record I just inserted, and this code actually works...I used it to test and make sure that data is being entered into the database table when I enter new data into the combo box.
This way, if I cant get my NotInList event working properly, I have an alternate way to make sure the typed route ID is recorded with the rest of the form info.
RowSource for Combo box is this:
SELECT DISTINCT ROUTE_NUMBER.ROUTE_NUMBER, ROUTE_NUMBER.PK_ROUTE_NUMBER FROM ROUTE_NUMBER WHERE ROUTE_NUMBER.ROUTE_NUMBER IS NOT NULL ORDER BY ROUTE_NUMBER.ROUTE_NUMBER;
and bound column is 1.
ÃaÃeVi£