Solved

Using MSComm in Microsoft Access 2003

Posted on 2006-12-01
6
1,582 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This video teaches viewers about errors in exception handling.
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…

617 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