Value to comm port

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hi,

Can anyone tell me how I can send the value of a
formfield to a comm port? I want to send this value to a
customer display with a cash system.

Frank
 
On some command button, insert code ( untested):

Open "Com1:9600,n,8,1" for output as #1
Print #1, me.txtMyWhatever
Close #1

Adjust the parameters in the "Com1,,," string to match whatever the
receiving device needs.
Com1 of course is the comport you want to use.
The print will add a trailing crlf to whatever is sent. To suppress this,
end the line with a semicolon ;


--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Adrian,

Thanks for your reply, the code is functioning very well!
I only have to make some code to clear the display after
some time and I'me done.

Regards,

Frank
 
A very good tool for doing serial communications directly from within
Access is a product called WinWedge from TAL Technologies.
You could write a very simple three line VBA subroutine in Access to
send anything that you want out a serial port through WinWedge.
For more information, please visit:
http://www.taltech.com/TALtech_web/products/winwedge.html

For a sample Access macro that demonstrates the technique described
above, visit:
http://www.taltech.com/TALtech_web/support/dde_sw/ddeaccess3.htm
 
Once you know the serial settings, baud rate etc, its easy:

Open "Com1:9600,n,8,1" for output as #1

Print#1,yourvalue
'repeat for as many values you want to send


Close #1

you may need a ; on the end of the print to suppress the normal CrLf
characters
Com1 of course is whatever com com port you are using
9600 = 9600 baud
n = no parity
8 = 8 data bits
1 = 1 stop bit
There are various other bits you can add to the command string to suppress
handshaking etc.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Back
Top