Hi,
I have written some code that inserts into the main table new data (Supplier's name) that is not in the combo box list (notinlist event). e.g:
Set dbsInvoice = CurrentDb()
Set rstTable = dbsInvoice.OpenRecordset("Supplier Table"
rstTable.AddNew
rstTable![SupplierName] = NewData
rstTable.Update
Response = acDataErrAdded
Following that I wish to open another form (Supplier's form) filtered on the NEW supplier's name.
I have tried the following code but it either opens on a blank record or if I do it twice it looks at the previous new data. Therefore I believe it has something to do with it not being saved even though it's been put into the Table.
NB: I cannot just add a save command as there are boxes
that would not have been completed at this point and
cannot contain a null value therefore creating an error
if saved!!
stDocName = "frm_Supplier Information"
stLinkCriteria = "[SupplierName]=" & "'" & Me!
[SupplierName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
I have tried all sorts of ways (including ones I got off of here yesterday in reply to jdwm2310)
Please can someone help its driving me mad!!
Keza
I have written some code that inserts into the main table new data (Supplier's name) that is not in the combo box list (notinlist event). e.g:
Set dbsInvoice = CurrentDb()
Set rstTable = dbsInvoice.OpenRecordset("Supplier Table"
rstTable.AddNew
rstTable![SupplierName] = NewData
rstTable.Update
Response = acDataErrAdded
Following that I wish to open another form (Supplier's form) filtered on the NEW supplier's name.
I have tried the following code but it either opens on a blank record or if I do it twice it looks at the previous new data. Therefore I believe it has something to do with it not being saved even though it's been put into the Table.
NB: I cannot just add a save command as there are boxes
that would not have been completed at this point and
cannot contain a null value therefore creating an error
if saved!!
stDocName = "frm_Supplier Information"
stLinkCriteria = "[SupplierName]=" & "'" & Me!
[SupplierName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
I have tried all sorts of ways (including ones I got off of here yesterday in reply to jdwm2310)
Please can someone help its driving me mad!!
Keza