strFieldValue Code

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?
 
A

Albert D.Kallal

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top