C
C_Ascheman
I have read through Allen Browne's DLookUp page. I am still having issues
with DLookUp though. Mainly in the formatting. I have a Table called Main
that has 2 fields called Month_End and Month_End_Total. On a tabular form I
have 2 unbound text boxes called MonthEnd and MonthEndTotal. What I am
attempting to do is to pull a value from Month_End_Total in Main, and place
that value in MonthEndTotal on the form where Month_End in the Table is equal
to MonthEnd on the form. Here is the code I have:
Private Sub MonthlyFill()
Dim strWhere As Variant
Dim ReportMonth As Integer
Dim ReportYear As Integer
ReportMonth = InputBox("Enter the Report Month:")
ReportYear = InputBox("Enter the Report Year:")
[MonthEnd] = ((ReportMonth - 1) & "/" & ReportYear)
strWhere = [MonthEnd]
[MonthEndTotal] = DLookup("Month_End_Total", "Main", "Month_End =" &
strWhere)
End Sub
It runs but never returns a value. I have multiple values entered into the
table, and have checked many times to make sure that I am inputing a value
that corresponds. It still pulls a null value. Any help would be greatly
appreciated.
C_Ascheman
with DLookUp though. Mainly in the formatting. I have a Table called Main
that has 2 fields called Month_End and Month_End_Total. On a tabular form I
have 2 unbound text boxes called MonthEnd and MonthEndTotal. What I am
attempting to do is to pull a value from Month_End_Total in Main, and place
that value in MonthEndTotal on the form where Month_End in the Table is equal
to MonthEnd on the form. Here is the code I have:
Private Sub MonthlyFill()
Dim strWhere As Variant
Dim ReportMonth As Integer
Dim ReportYear As Integer
ReportMonth = InputBox("Enter the Report Month:")
ReportYear = InputBox("Enter the Report Year:")
[MonthEnd] = ((ReportMonth - 1) & "/" & ReportYear)
strWhere = [MonthEnd]
[MonthEndTotal] = DLookup("Month_End_Total", "Main", "Month_End =" &
strWhere)
End Sub
It runs but never returns a value. I have multiple values entered into the
table, and have checked many times to make sure that I am inputing a value
that corresponds. It still pulls a null value. Any help would be greatly
appreciated.
C_Ascheman