Update access textbox from VB.net (1 Viewer)

desmond

Registered User.
Local time
Today, 16:50
Joined
Dec 8, 2009
Messages
28
Does anyone know how to update a textbox value on an Access form from VB.NET?

Dim oAccess As New Access.Application
oAccess.OpenCurrentDatabase(filepath:="C:\TestDB.accde", Exclusive:=True)
oAccess.Visible = False
oAccess.DoCmd.OpenForm(FormName:="Main_Form", View:=Access.AcFormView.acNormal)

I want to be able to update the textbox, then click a form button from VB.NET without oAccess.visible = true.

Can anyone help????!!!
 

ripp3r

Registered User.
Local time
Today, 06:50
Joined
Apr 9, 2009
Messages
11
Does anyone know how to update a textbox value on an Access form from VB.NET?

Dim oAccess As New Access.Application
oAccess.OpenCurrentDatabase(filepath:="C:\TestDB.accde", Exclusive:=True)
oAccess.Visible = False
oAccess.DoCmd.OpenForm(FormName:="Main_Form", View:=Access.AcFormView.acNormal)

I want to be able to update the textbox, then click a form button from VB.NET without oAccess.visible = true.

Can anyone help????!!!

This doesn't help?

Code:
MyTextBox.text = "The new text"
 

SOS

Registered Lunatic
Local time
Yesterday, 22:50
Joined
Aug 27, 2008
Messages
3,517
You need more automation objects sort of like this (I've not gone this route before so can't guarantee 100% accuracy):
Code:
Dim oAccess As New Access.Application
Dim acFrm As New Access.Form

oAccess.OpenCurrentDatabase(filepath:="C:\TestDB.a ccde", Exclusive:=True)
oAccess.Visible = False
Set acFrm = oAccess.Forms("Main_Form")
acFrm.Controls("YourTextBoxNameHere").Value = "Whatever"
Call acFrm.YourCommandButtonNameHere_Click()

(that is AIR CODE - untested)
 

Users who are viewing this thread

Top Bottom