G
Guest
Why won’t this work? There is possibly a better way to do this. I’m a beginner.
Private Sub LandDescription_Click()
On Error GoTo Err_LandDescription_Click
Dim TmpTractFull As String
Dim TmpCounty As String
Dim TmpState As String
Dim TmpSurveyTownshipName As String
Dim TmpAbstractTownship As String
TmpTractFull = Left(Forms!OGLease![OGLTract Subform]![TractFull], 10)
‘Parse Left 10 out of TX102-0635-0140 which is TractFull assign to
TmpTractFull As String
TmpSurveyTownshipName = DLookup("[Survey/TownshipName]", "Survey",
"[Abstract/TownshipFull] = " & "TmpTractFull")
‘Abstract/TownshipFull is TX102-0635 which is index field get
Survey/TownshipName
TmpAbstractTownship = DLookup("[Abstract/Township]", "Survey",
"[Abstract/TownshipFull] = " & "TmpTractFull")
‘Abstract/TownshipFull is TX102-0635 which is index field get
Abstract/Township “0635â€
TmpCounty = DLookup("[County]", "County", "[CountyFull] = " &
Left(TmpTractFull, 5)
‘ Get the County Name
Rem TmpState = DLookup("[State]", "County", "[CountyFull] = " &
Left(TmpTractFull), 5)
‘Get the State
LandLease = LandLease & Forms!OGLease![OGLTract Subform]![Acres] & " acres,
more or less, part of the " & [TmpSurveyTownshipName] & ", Abstract " &
[TmpAbstractTownship] & "in " & [TmpCounty] & " County, " & [TmpState] & "and
described in " & " dated " & " " & " and recorded in Volume
" & " Page " & " Records of " & [TmpCounty] & " County, " &
[TmpState] & "."
‘Click button to help fill the description in LandLease Memo field.
Exit_LandDescription_Click:
Exit Sub
Err_LandDescription_Click:
MsgBox Err.Description
Resume Exit_LandDescription_Click
End Sub
Private Sub LandDescription_Click()
On Error GoTo Err_LandDescription_Click
Dim TmpTractFull As String
Dim TmpCounty As String
Dim TmpState As String
Dim TmpSurveyTownshipName As String
Dim TmpAbstractTownship As String
TmpTractFull = Left(Forms!OGLease![OGLTract Subform]![TractFull], 10)
‘Parse Left 10 out of TX102-0635-0140 which is TractFull assign to
TmpTractFull As String
TmpSurveyTownshipName = DLookup("[Survey/TownshipName]", "Survey",
"[Abstract/TownshipFull] = " & "TmpTractFull")
‘Abstract/TownshipFull is TX102-0635 which is index field get
Survey/TownshipName
TmpAbstractTownship = DLookup("[Abstract/Township]", "Survey",
"[Abstract/TownshipFull] = " & "TmpTractFull")
‘Abstract/TownshipFull is TX102-0635 which is index field get
Abstract/Township “0635â€
TmpCounty = DLookup("[County]", "County", "[CountyFull] = " &
Left(TmpTractFull, 5)
‘ Get the County Name
Rem TmpState = DLookup("[State]", "County", "[CountyFull] = " &
Left(TmpTractFull), 5)
‘Get the State
LandLease = LandLease & Forms!OGLease![OGLTract Subform]![Acres] & " acres,
more or less, part of the " & [TmpSurveyTownshipName] & ", Abstract " &
[TmpAbstractTownship] & "in " & [TmpCounty] & " County, " & [TmpState] & "and
described in " & " dated " & " " & " and recorded in Volume
" & " Page " & " Records of " & [TmpCounty] & " County, " &
[TmpState] & "."
‘Click button to help fill the description in LandLease Memo field.
Exit_LandDescription_Click:
Exit Sub
Err_LandDescription_Click:
MsgBox Err.Description
Resume Exit_LandDescription_Click
End Sub