Discussion Locked

visual basic to access

0 helpful
12 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi, Does any body know a way or tool to convert a Visual Basic 5 project to Microsoft Access 97 or 2000.
I was able to transfer/convert some of the code and forms.
But I'm having a hard time converting a few PicturBoxes to somethinbg similar in Microsoft Access.
Thankx

12 replies

by the terminated

Could you please describe your problem with the PictureBox conversion? What do you need to do that the Access Image control won't let you do?

by jesus h

Thanks.
This is a Data Collection System Monitor program.
It constantly refreshes the screen showing the status of 25 terminals (ie. terminal is not connected, online, executing, etc.), also each line has diffrent visual properties (color, font, etc.).
this is an extract from Visual Basic:
Picture1.Print terminal(i).ID + Space(1) + terminal(i).Role + Space(1) + terminal(i).Name;

If I use TextBoxes (25), I tried the following sample bur doesn't work:
for i=1 to 25
Me.text(i) = terminal(i).ID + Space(1) + terminal(i).Role + Space(1) + terminal(i).Name
next i

by jesus h

This is a Data Collection System Monitor program.
It was made using Visual Basic 5.
I do not know much about Visual Basic, I do not have a newer version.
But I know more about Microsoft Access.

by a contractor

To answer your question, we need more details. Screen shots of what VB does now would be good.

Also, you may have to go to Access XP or 2003 to do what you want. Access 97 may not be supported much longer (if it stil is) and Access 2000 isn't too far behind.

The other question is why Access? Because reports and adhoc stuff is much better and it is easier to encorporate user developed stuff in Access than in VB. I can deploy easier than VB.

by jesus h

Thanks.
This is a Data Collection System Monitor program.
It constantly refreshes the screen showing the status of 25 terminals (ie. terminal is not connected, online, executing, etc.), also each line has diffrent visual properties (color, font, etc.).
this is an extract from Visual Basic:
Picture1.Print terminal(i).ID + Space(1) + terminal(i).Role + Space(1) + terminal(i).Name;

If I use TextBoxes (25), I tried the following sample bur doesn't work:
for i=1 to 25
Me.text(i) = terminal(i).ID + Space(1) + terminal(i).Role + Space(1) + terminal(i).Name
next i

It was made using Visual Basic 5.
I do not know much about Visual Basic, I do not have a newer version.
But I know more about Microsoft Access, of course once I do the conversion I will go for a newer version of Access.

by the terminated

Access doesn't have arrays of text boxes, only arrays of toggle buttons, option buttons, and check boxes. If, for example, you had 5 test boxes called txtTerminal1, txtTerminal2, ...txtTerminal5 you could do this:

Private Sub btnDemo_Click()
Dim i As Integer
Dim strFoo(5) As String
strFoo(0) = "alpha"
strFoo(1) = "bravo"
strFoo(2) = "charlie"
strFoo(3) = "delta"
strFoo(4) = "echo"

For i = 1 To 5
Me("txtTerminal" & i).SetFocus
Me("txtTerminal" & i).Text = strFoo(i - 1)
Me("txtTerminal" & i).FontSize = 8 + i
Next
End Sub

by jesus h

Thanks.
Yeah, it works.
Using this technique I could display the info on all the text boxes.

This is some of the code (Text boxes are Text(1), Text(2), etc):
...
For i = DisplayPointer To UBound(terminal)
strTempTxt = "Text(" & i & ")"
Forms("frmTermStatus")(strTempTxt) = terminal(i).id + Space(10) + terminal(i).Role + Space(10) + terminal(i).Name + Space(8) + terminal(i).State
...

Thanks

This discussion is closed to new replies.