Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1591
  • Last Modified:

Using MSComm in Microsoft Access 2003

Hi,
I have developed a POS sytem using Microsoft Access.  I am using MSComm to transmit information to a pole display, which works fine.  I have different forms that  needs to send information to the Pole Display.  I would like to work with only one form that has MSComm controls.  So,  I created a form and called it CommForm, and I called the MSComm control commpd. I created another form with a command button and I paste the attached code to it.  When I click on the command button, I get the following message: Run-time error '91' Object variable or with block variable not set.  I don't know what commands I am missing.  Can someone please help.

Private Sub Command0_Click()

If CommForm.commpd.PortOpen = False Then
    CommForm.commpd.PortOpen = True
End If

Dim s As String
s = "testing"
CommForm.commpd.Output = s

End Sub
0
rowenab
Asked:
rowenab
1 Solution
 
mquirozCommented:
are you sure that the form with the control is already open when the code executes?

it seems that you're triyng to use a control that doesn't exist at runtime yet...
0
 
rowenabAuthor Commented:
yes, the form with the controls are open
0
 
rowenabAuthor Commented:
Hello
I figured out the problem.  My form works fine using global variables.  This question can now be closed.
0
 
taycuong76Commented:
You have to load form CommForm first, then fire it from the other form wwhich has command1 button.
MScomm control have no property nor method nor constant named "commpd".
0
 
Computer101Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now