Problem passing data

Stuart Green

Registered User.
Local time
Today, 11:54
Joined
Jun 24, 2002
Messages
108
Not very well up on VBA but I have found in one of the many books on Access a routine that would be handy for my users whereby they can double click on a memo field ina form and bring up a bigger entry form, spell check it and then pass the data back (better than the built on zoom option). The double click action runs the following

Private Sub comments_DblClick(Cancel As Integer)
workspace Me.ActiveControl, Me

End Sub


There is a sub routine as follows

Sub workspace(ctl As Control, callingform As Form)

callingform.Refresh
Set gctlworkspacesource = ctl
DoCmd.OpenForm "frmworkspace", windowmode:=acDialog


This is supposed to take the value of the field I have double clicked on and pass it to gctlworkspacesource, (which it is doing). It then opens the form called "frmworkspace". The problem I am having is with the on load action for the form "frmworkspace" and passing the value of gctlworkspacesource over as follows

Me.txtworkspace = gctlworkspacesource

When it opens I get the message "variable not defined" for gctlworkspacesource. This does seem logical but I can't find anywhere in the sample code where to do this

There may be something basic that I am missing but I am an innocent among wolves when it comes to this stuff!
 
Open a Modal Form

Did this a while ago and it works fine

'This is the Memo field on the Form - strClientNumber is the linking record
Private Sub Notes_DblClick(Cancel As Integer)

DoCmd.RunCommand acCmdSaveRecord
Number.SetFocus
strClientNumber = Number.Value

DoCmd.OpenForm "Fmodal-Notes", , , "[number] = " & strClientNumber & ""

End Sub

then ...

Create a simple form with a larger Memo field - Properties Modal = Yes PopUp = Yes

with a Close button coded as follows.

Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click

DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close

Exit_cmdClose_Click:
Exit Sub

Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click

End Sub

Not sure about the spell checking part. If you get that please let me know.
 

Users who are viewing this thread

Back
Top Bottom