VBA help required (again)

JonAW

Member
Join Date
Sep 2013
Location
Somewhere
Posts
121
Hi Guys,

I'm having difficulty converting any numeric data from a recordset pulled from MS Access to display as a string in a text element in FTV SE. I can display it in a textbox which I can live with if really necessary but it would be 'nice' to be able to display my data through standard text. Below is an example of my code.

Using the first example it will display string fields from my recordset when called.

First I tried this:
MyBatchForm.Elements.Item("Text1").Caption = rs("BatchID")

Then I tried this:

Dim MyTest1 As Long
Dim MyTest2 As String

MyTest1 = rs("BatchID")
MyTest2 = CStr(MyTest1)
MyBatchForm.Elements.Item("Text1").Caption = MyTest2

It's just not working for me. Anyone got any ideas?

thanks

Jonny
 
Hi RdRast,

It's a double click on a list box calling to open another display (you helped me there as well) and populating data from the recordset, selected via the listbox, into the display. All items are exposed to VBA. The error is Error(91) object variable or with block not set.

The routine works fine if I reference any string based fields in the recordset to populate a text element but refuses to populate the same text element when I reference any numeric based fields. Even when using the convert function it refuses to work. If I change the text element to a textbox I can put any type of data into here using the same routine no issues.

Jonny
 

Similar Topics

Hi, I'm pretty new to the RSVIEW32 & have encounted a problem whilst coding visual basic. The error is:- Compile Error: Sub or Function not...
Replies
6
Views
2,167
I'm creating an HMI that has a recipe with 288 data point. It has 3 pieces of data for 96 segments. I need help with VBA code to copy all 288...
Replies
0
Views
140
Good morning/afternoon all, Part 1) I am working on a trending application where I am trying to have a button open a trend page though I...
Replies
0
Views
1,087
I'm begginer at VBA. What should be the correct way to check if a display is currently showing and then show another display? I tried to put this...
Replies
17
Views
8,361
I have a alarm banner A display that shows on the botton of the screen and that must shown along with any of two specific main centered displays...
Replies
2
Views
2,040
Back
Top Bottom