Refreshing a text box

StupidStudent

Registered User.
Local time
Today, 16:03
Joined
Mar 12, 2007
Messages
29
Hi all

Does anyone know the VB code to update a text whenever a form is opened?

Thanks

:)
 
Can you be more specific?

By the sounds of things you should set the focus to the text box and set the text. ie.
txtMyTextBox.setfocus
txtMyTextBox.text = "Text"
 
Hi

thanks for quick reply

What i am trying to do is

I have a query that counts how many records have been saved..

And I have a txtBox which recieves the value from that query

However as this txtBox is going towards making a primary key i need it to update every time the form is opened

Also does anyone know how i would set a value form a query to a int varible?

Thanks again
 
Hi

thanks for quick reply

What i am trying to do is

I have a query that counts how many records have been saved..

And I have a txtBox which recieves the value from that query

However as this txtBox is going towards making a primary key i need it to update every time the form is opened

Also does anyone know how i would set a value form a query to a int varible?

Thanks again
 
What's wrong with this?:

txtMyTextBox.setfocus
txtMyTextBox.text = DCount("[Any Field Name Here"],[QueryNameHere]")

Look at CInt for Casting to Integers.
 

Users who are viewing this thread

Back
Top Bottom