O
Opal
I am using Access 2003 and am trying to create a form
for my users to calculate percentages based on values
that they input. I have the form working just the way
I want, but am having trouble interfacing it back to the
main form.
The pop-up form calculates 2 values in fields called:
[NTDR] and [NADR] in frmDRPopup
I now want these two values to appear in frmQtrUpt
in the fields [TDR] and [ADR] - this form is a bound
form. The frmDRPopup form is unbound.
The fields in both forms are formated as percent with
one decimal place. I formatted the fields on the bound
form as:
Field Size: Decimal
Format: Percent
I am trying the following:
Dim HoldTDR As Integer
Dim HoldADR As Integer
Dim dbObject As DAO.Database
Dim DRCalcRS As DAO.Recordset
Dim strQuery As String
HoldTDR = Forms!frmDRPopup!NTDR.Value
HoldADR = Forms!frmDRPopup!NADR.Value
Set dbObject = CurrentDb
strQuery = "SELECT * FROM AMQtr;"
Set DRCalcRS = dbObject.OpenRecordset(strQuery)
DRCalcRS.AddNew
DRCalcRS!ADR = HoldADR
DRCalcRS!TDR = HoldTDR
DRCalcRS.Update
and I get a type mismatch error.
I tried this instead:
' HoldTDR = Format(Forms!frmDRPopup!NTDR, "Percent")
' HoldADR = Format(Forms!frmDRPopup!NADR, "Percent")
and still get a type mismatch error. I am missing something
so would appreciate any assistance / direction you can give.
Thank you.
for my users to calculate percentages based on values
that they input. I have the form working just the way
I want, but am having trouble interfacing it back to the
main form.
The pop-up form calculates 2 values in fields called:
[NTDR] and [NADR] in frmDRPopup
I now want these two values to appear in frmQtrUpt
in the fields [TDR] and [ADR] - this form is a bound
form. The frmDRPopup form is unbound.
The fields in both forms are formated as percent with
one decimal place. I formatted the fields on the bound
form as:
Field Size: Decimal
Format: Percent
I am trying the following:
Dim HoldTDR As Integer
Dim HoldADR As Integer
Dim dbObject As DAO.Database
Dim DRCalcRS As DAO.Recordset
Dim strQuery As String
HoldTDR = Forms!frmDRPopup!NTDR.Value
HoldADR = Forms!frmDRPopup!NADR.Value
Set dbObject = CurrentDb
strQuery = "SELECT * FROM AMQtr;"
Set DRCalcRS = dbObject.OpenRecordset(strQuery)
DRCalcRS.AddNew
DRCalcRS!ADR = HoldADR
DRCalcRS!TDR = HoldTDR
DRCalcRS.Update
and I get a type mismatch error.
I tried this instead:
' HoldTDR = Format(Forms!frmDRPopup!NTDR, "Percent")
' HoldADR = Format(Forms!frmDRPopup!NADR, "Percent")
and still get a type mismatch error. I am missing something
so would appreciate any assistance / direction you can give.
Thank you.