C
Christina Gonzalez
I already tried this that does not work. IT IS and
UNBOUND FIELD!
UNBOUND FIELD!
Christina Gonzalez said:OK an UNBOUND CONTROL, UNBOUND TEXTBOX, I think you get
the picture....! Did not get the terminology
right...Does not work, ok let me explain what does not
work mean, this code does not work....
Private Sub txtBOMAdjValue_AfterUpdate()
If Not IsNull(Me.txtBOMAdjValue) Then
intBOMAdjVal = Me.txtBOMAdjValue
End If
End Sub
The user must type a value in this UNBOUND CONTROL!!!
txtBOMAdjValue, intBOMAdjVal is a global variable and
declared as such in a module.
Then i created a command button that does this
calculation.
Private Sub cmdCalculateTotals_Click()
If IsNull(sngBOMTotl = DSum("[Total
Cost]", "qryBOMSummary", "[RFQID] = " & [Forms]!
[frmRFQSummary]![RFQID])) Then
MsgBox "No Values to Calculate for BOM!"
Else
sngBOMTotl = DSum("[Total
Cost]", "qryBOMSummary", "[RFQID] = " & [Forms]!
[frmRFQSummary]![RFQID])
sngBOMTotl = Round(sngBOMTotl, 4)
Form_frmRFQSummary.Refresh
End If
If Not IsNull(intBOMAdjVal) Then
***Me.txtBOMTotal = sngBOMTotl + intBOMAdjVal****
Me.txtBOMTotal = Round(sngBOMTotl, 4)
Form_frmRFQSummary.Refresh
End If
End Sub
The code with the * does not work because Access does not
see this intBOMAdjVal variable because the value is
coming from the UNBOUND CONTROL....HELP! Is there anyone
that has a real answer???????
-----Original Message-----
I assume you mean an unbound control as there is no such thing as an unbound field.
What does "does not work" mean? Do you get an error? The syntax provided should
work as long as the control does not have an expression as its ControlSource.
.
somewhere else that is doing that?-----Original Message-----
Assuming intBOMAdjVal is dimmed as an integer then this line...
If Not IsNull(intBOMAdjVal) Then
....is pointless as an integer variable can never be null. Only variables of type
variant can be null. So if you were using that to see if the user entered something
in the TextBox then it is incorrect.
Your Private Sub txtBOMAdjValue_AfterUpdate() code is not forcing the user to enter
something into the control unless you have code
test it for null when the buttonOtherwise the integer variable will just retain whatever value it was last assigned
to (or zero if it was never assigned a value).
If you want to force an entry in the control why not
is pressed and then display an error if the control is not filled in? In that case
you don't even need the AfterUpdate code. Just test the control for null when the
button is pressed and then run the rest of your routine if an entry was made.
OK an UNBOUND CONTROL, UNBOUND TEXTBOX, I think you get
the picture....! Did not get the terminology
right...Does not work, ok let me explain what does not
work mean, this code does not work....
Private Sub txtBOMAdjValue_AfterUpdate()
If Not IsNull(Me.txtBOMAdjValue) Then
intBOMAdjVal = Me.txtBOMAdjValue
End If
End Sub
The user must type a value in this UNBOUND CONTROL!!!
txtBOMAdjValue, intBOMAdjVal is a global variable and
declared as such in a module.
Then i created a command button that does this
calculation.
Private Sub cmdCalculateTotals_Click()
If IsNull(sngBOMTotl = DSum("[Total
Cost]", "qryBOMSummary", "[RFQID] = " & [Forms]!
[frmRFQSummary]![RFQID])) Then
MsgBox "No Values to Calculate for BOM!"
Else
sngBOMTotl = DSum("[Total
Cost]", "qryBOMSummary", "[RFQID] = " & [Forms]!
[frmRFQSummary]![RFQID])
sngBOMTotl = Round(sngBOMTotl, 4)
Form_frmRFQSummary.Refresh
End If
If Not IsNull(intBOMAdjVal) Then
***Me.txtBOMTotal = sngBOMTotl + intBOMAdjVal****
Me.txtBOMTotal = Round(sngBOMTotl, 4)
Form_frmRFQSummary.Refresh
End If
End Sub
The code with the * does not work because Access does not
see this intBOMAdjVal variable because the value is
coming from the UNBOUND CONTROL....HELP! Is there anyone
that has a real answer???????
such-----Original Message-----
I assume you mean an unbound control as there is no
thing as an unbound field.expressionWhat does "does not work" mean? Do you get an error? The syntax provided should
work as long as the control does not have an
as its ControlSource.I already tried this that does not work. IT IS and
UNBOUND FIELD!
-----Original Message-----
me!fieldname=variablename
Hope this helps!
Kevin
-----Original Message-----
how do assign a variable to an unbound field?
.
.
.
.
Christina Gonzalez said:If Not is Null is NOT the ISSUE...ok, my issue is
assigning a variable to an unbound textbox... I need this
if not is null variable for good reason...which i don't
wish to explain at this time. I understand your
point...however my issue is assigning a variable to an
unbound textbox...OK an UNBOUND CONTROL, UNBOUND TEXTBOX, I think you get
the picture....! Did not get the terminology
right...Does not work, ok let me explain what does not
work mean, this code does not work....
Private Sub txtBOMAdjValue_AfterUpdate()
If Not IsNull(Me.txtBOMAdjValue) Then
intBOMAdjVal = Me.txtBOMAdjValue
End If
End Sub
The user must type a value in this UNBOUND CONTROL!!!
txtBOMAdjValue, intBOMAdjVal is a global variable and
declared as such in a module.
Then i created a command button that does this
calculation.
Private Sub cmdCalculateTotals_Click()
If IsNull(sngBOMTotl = DSum("[Total
Cost]", "qryBOMSummary", "[RFQID] = " & [Forms]!
[frmRFQSummary]![RFQID])) Then
MsgBox "No Values to Calculate for BOM!"
Else
sngBOMTotl = DSum("[Total
Cost]", "qryBOMSummary", "[RFQID] = " & [Forms]!
[frmRFQSummary]![RFQID])
sngBOMTotl = Round(sngBOMTotl, 4)
Form_frmRFQSummary.Refresh
End If
If Not IsNull(intBOMAdjVal) Then
***Me.txtBOMTotal = sngBOMTotl + intBOMAdjVal****
Me.txtBOMTotal = Round(sngBOMTotl, 4)
Form_frmRFQSummary.Refresh
End If
End Sub
The code with the * does not work because Access does not
see this intBOMAdjVal variable because the value is
coming from the UNBOUND CONTROL....HELP! Is there anyone
that has a real answer???????
-----Original Message-----
I assume you mean an unbound control as there is no such
thing as an unbound field.
What does "does not work" mean? Do you get an error?
The syntax provided should
work as long as the control does not have an expression
as its ControlSource.
message
I already tried this that does not work. IT IS and
UNBOUND FIELD!
-----Original Message-----
me!fieldname=variablename
Hope this helps!
Kevin
-----Original Message-----
how do assign a variable to an unbound field?
.
.
.
.