I have very little knowledge of VB and am trying to do a stock controls/sales/purchases system on a database - have found some code in a text book that seems to solve all my problems but it doesn't want to work. I get an 'invalid Null' message when I use it. I assume that this is because there is nothing in the field until I select which stock code I want to sell/purchase.
the code is added to the On Exit so I don't understand why it rejects as soon as I go into the field?
Code is:
Dim StockNum as Long
StockNum = StockID (This is what returns the invalid Null)
DoCmd.OpenForm "stock"
StockId.SetFocus
DoCmd.FindRecord StockNum
Forms![sales orders]![sales trans Subform].Form
I also get a message saying that the subform can't be found - syntax error?
I have been struggling with this for days - read Access help files which may as well be written in Martian.
Please help - with explanations (for dummies). I can't attach the d/b it's too big
Thank you.
the code is added to the On Exit so I don't understand why it rejects as soon as I go into the field?
Code is:
Dim StockNum as Long
StockNum = StockID (This is what returns the invalid Null)
DoCmd.OpenForm "stock"
StockId.SetFocus
DoCmd.FindRecord StockNum
Forms![sales orders]![sales trans Subform].Form
I also get a message saying that the subform can't be found - syntax error?
I have been struggling with this for days - read Access help files which may as well be written in Martian.
Please help - with explanations (for dummies). I can't attach the d/b it's too big
Thank you.