| View previous topic :: View next topic |
| Author |
Message |
smaclee Newbie

Joined: 10 Sep 2010 Posts: 2
|
Posted: Fri Sep 10, 2010 9:08 pm Post subject: Set variable to the value in a field |
|
|
I have what I thought was a basic question, but can not find an answer.
I need to set a variable "row" to equal the existing content of a field shown on a form. The form is called "Main_menu" and the form field is called "Entrynofield".
I have declared row with:
Dim row = Integer
(because Entrynofield refers to a table field that is stored as a number)
However can not seem to set row to equal the value held in this field. Can anyone please help? Been trying for so long this is getting kinda urgent for me unfortunately.
Thanks in advance |
|
| Back to top |
|
 |
cilt Power User

Joined: 20 May 2010 Posts: 89
|
Posted: Sun Sep 12, 2010 4:59 pm Post subject: |
|
|
thiswhat you looking for?
it assumes that the sub is being run from the form which contains the field
| Code: |
sub getrow
Dim Doc As Object
Dim Forms As Object
Dim Form As Object
Dim Ctl As Object
dim row as integer
Doc = ThisComponent
Forms = Doc.Drawpage.Forms
Form = Forms.GetbyIndex(0)
Ctl = Form.GetbyName("Entrynofield")
row = Ctl.CurrentValue
msgbox row
end sub
|
|
|
| Back to top |
|
 |
smaclee Newbie

Joined: 10 Sep 2010 Posts: 2
|
Posted: Mon Sep 13, 2010 2:21 am Post subject: |
|
|
| Looks good, thanks heaps. |
|
| Back to top |
|
 |
|