Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using MSComm in Microsoft Access 2003

Posted on 2006-12-01
6
Medium Priority
?
1,590 Views
Last Modified: 2008-01-09
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
Comment
Question by:rowenab
6 Comments
 
LVL 7

Expert Comment

by:mquiroz
ID: 18073797
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
 

Author Comment

by:rowenab
ID: 18079049
yes, the form with the controls are open
0
 

Author Comment

by:rowenab
ID: 18090394
Hello
I figured out the problem.  My form works fine using global variables.  This question can now be closed.
0
 
LVL 3

Expert Comment

by:taycuong76
ID: 18091467
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
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18231888
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question