Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I display text from 2 buffers?

Status
Not open for further replies.

alanjmartin

Technical User
May 17, 2005
13
GB
I am writing a little script which makes a call on com1. I am now trying to display the incoming and outgoing data, read from 2 buffers as the transmission proceeds. I envisage a little screen with the data scrolling with one direction in one colour and the opposite direction in another. Is this possible in Access 2000
 
If I understand you correctly you just need a form with two unbound text box controls on it.
Call them txtIn and txtOut

Each new item goes in at the bottom of txtIn so as each new bit of text comes along you have some code that goes

Code:
txtIn = txtIn & vbCrLf & NewText
intC = intC + 1
If intC > 25 Then
    ' Delete the top row
    txtIn = Mid(txtIn, InStr(txtIn, vbCrLf) + 2)
End If


With txtOut each new item goes at the top so
Code:
intC = intC + 1
If intC > 25 Then
    ' Delete bottom row
    txtOut = Left(txtOut, InStrRev(txtOut, vbCrLf) - 1)
End If
txtOut = NewText & vbCrLf & txtOut

Edit the intC > 25 to however many rows you want to display in each.
Change names and direction to suit your needs.


'ope-that'elps.






G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Thanks for that LittleSmudge.

I should have said that I am a novice to all this. I am not sure how I can implement your suggestions.

I have put together this tiny piece of code which works. Before I add to this I need to be able to display / record the tx and rx data.

Can you help?

Private Sub Command1_Click()

Dim activexctl3_oncomm As Object
Dim instring As String
txtIn = buffer$
ActiveXCtl3.CommPort = 1
ActiveXCtl3.Settings = "9600,n,8,1"
ActiveXCtl3.InputLen = 0
ActiveXCtl3.PortOpen = True
ActiveXCtl3.Output = "atd0162xxxxxxx" & Chr$(13)
Do
DoEvents
buffer$ = buffer$ & ActiveXCtl3.InputData
Loop Until InStr(buffer$, "Connect" & vbCrLf)
ActiveXCtl3.PortOpen = False
End Sub

Alan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top