strFieldValue Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following code being used to place a value into another field when
clicking on another field.

Private Sub E1_DblClick(Cancel As Integer)
Dim strFieldValue As String

Let strFieldValue = E1.Value

If IsNull (Forms!frmToleranceChartMain1!Tol1.Value) Then
Let Forms!frmToleranceChartMain1!Tol1.Value = strFieldValue
Else

End If

End Sub

What I want it to also do is take the value from "E2" and place it in "Tol2"
but I want this to work when I "DblClick" on "E1" like I have it set up in
the code above. I want to make it easier for the users to only have to click
on one field instead of two. Can this be done?
 
try the folwing

Private Sub E1_DblClick(Cancel As Integer)

if IsNull(me.Tol1) = True then
me.Tol1 = me.E1
end if
if isnull(me.Tol2) then
me.Tol2 = me.E2
end if

End Sub
 
Back
Top