new form using checkbox (1 Viewer)

goldres

New member
Local time
Today, 12:17
Joined
Oct 10, 2013
Messages
8
I downloaded Checkbox open form.zip from this site (thank you Ansentry)and looked at the code. it is exactly what i needed to use thank you.

It uses option group for teh checkboxes

It runs perfectly when I double click in access but i would like to use this in vba when called from another form. When i put the code in and try to run it I get the error:

Compile Error
Method or data member not found

It is referring to .Frame8

here is the code i used

DoCmd.OpenForm "Mainform", acNormal

Select Case Me.Frame8
Case 1
Open Form 1
Case 2
Open Form 2
Case 3
Open Form 3
Case Else
MsgBox "You did not make a selection"
End Select

Please can you help me

Many thanks

Gary
 

Attachments

here is the code i used

DoCmd.OpenForm "Mainform", acNormal

Select Case Me.Frame8
Case 1
Open Form 1
Case 2
Open Form 2
Case 3
Open Form 3
Case Else
MsgBox "You did not make a selection"
End Select

Please can you help me

Many thanks

Gary
Where did your place that code, "DoCmd.OpenForm "Mainform", acNormal " and "Case 3 Open Form 3" isn't in your database!
 
The code I used is:

Private Sub Deviation_Form_Click()

Call Frame8_Click

End Sub

Private Sub Frame8_Click()

Dim Form1 As String

Form1 = "D:\Hamba Kusasa Forms\Deviation Form.pdf"

MsgBox "about to open form"

DoCmd.OpenForm "Mainform", acNormal, , , , , Form1

MsgBox "before case"

Select Case Me.Frame8

Case 1

CreateObject("Shell.Application").Namespace(0).ParseName("D:\Hamba Kusasa Forms\Deviation Form.pdf").InvokeVerb ("Open")

Case 2

CreateObject("Shell.Application").Namespace(0).ParseName("D:\Hamba Kusasa Forms\Deviation Form.pdf").InvokeVerb ("Print")

Case 3

Call Doemail

Case Else
MsgBox "You did not make a selection"

End Select

End Sub

Private Sub cmdReset_Click()

Me.Frame8.Value = ""

End Sub

The form I am trying to call and use is attached as mainform.accdb (I have imported the form into my database. As you can see what I am trying to do is to give the use the option of what to do with the document they have selected - View it, print it or email it. Each of the options work individually but I cannot get this to call and use the form so that the user can select what they want to do.
 

Attachments

Sorry - I don't understand what you are trying to do.
And you show one piece of code in your post but it isn't in you database.
I think I'll leave it here - luck with your project.
 
The original "mainform.zip" was an example of a form I am trying to use. I have modified it and now it is in mainform.accdb

The code here and the attached mainform.accdb are the code that I am actually trying to use.

Here is what I am trying to do. I have a system that has a lot of pdf documents stored to a folder on the hard disk. In my system currently the user can select a button and this will automatically print the required pdf from the folder using

CreateObject("Shell.Application").Namespace(0).Par seName("D:\Hamba Kusasa Forms\Deviation Form.pdf").InvokeVerb ("Print")

Now what I want to do is call the form mainform.accdb attached previously to give the user the ability to select whether they want to view, print or email the pdf document

I am very new to access and so am not sure how to do this. I have inserted the code from mainform.aacdb into my database but when I try to run it it gives me the error I mentioned.

If I run mainform.aacdb on its own then it works perfectly so I do not know what I am doing wrong. I am sure that I am not calling the form mainform correctly and that is what is wrong
 
Sorry - I don't understand what you are trying to do.
And you show one piece of code in your post but it isn't in you database.
I think I'll leave it here - luck with your project.


No worries I have solved this problem myself
 

Users who are viewing this thread

Back
Top Bottom