Control displays correct content but string doesnt

shabbaranks

Registered User.
Local time
Today, 20:48
Joined
Oct 17, 2011
Messages
300
Hi,

I think this is a daft question butr I cant see why Im not getting the correct result.

Here is my code
Code:
Dim sPONum As Integer
sPONum = Me.PONumb_TxtBox

If I put a break point at the button and hover my mouse over Me.PONumb_TxtBox it returns the correct value, but if I hover my mouse over sPONum its blank. Can someone tell me what Im doing wrong please?

Thanks:confused:
 
Because the variable hasn't yet been set. It needs to go past that line before it gets set.
 
Another (simple one for you but I cant see why) my code isnt entering into the subform within the main form.

Here's what I did - I took a copy of the main table and then renamed it "-temp". I then dragged that table into the main form in which then a subform is created. Now I thought my VBA should insert into the "temp table" the mysql code:

Code:
Mysql = "Insert INTO Table-Temp (.....
 
DoCmd.SetWarnings False
DoCmd.RunSQL Mysql
DoCmd.SetWarnings True
Me.Subformname_subform.Requery

But it doesnt add it to the subform\table. All recirds are valud as I do a break point and they are correct.
The data goe
 

Users who are viewing this thread

Back
Top Bottom