Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some basic help on VB6 to access

Status
Not open for further replies.

pe

Technical User
Aug 8, 2001
31
US
I have office xp developer and vb6 pro. My users have w95 and office 97, they don't have access at all, just word and excel97. So I am trying to develop a front-end in vb6 for them because when I try to make a run-time version of my access xp database it won't run on their computers.

I am using a DAO control on my vb6 form connected to my mdb which i converted to access 97. Then i put text boxes so my users can enter data into the tables of my mdb. I want them to enter data for each project they work on. The projects have client name and job number. More than one project can have the same client and the same job number. I have a separate tblPROJECT, tblCLIENT and tblJOBNO in my mdb.

How can I make a drop-down box that holds the clients names and allows the user to enter a new client if it's not in the box? Or, is there a better way to do this in VB6.

I appreciate any help or suggestions. Thank you very much.
 
Hi pe.

A good way to do this, although some users don't like this, is to create a form where they will enter new client names in a text box that will populate a grid. That way, they will need to enter the name only once (this will prevent users from entering the same name differently: Mike Johns, mike johns, Mike Jones...)
Then on the regular form, they only access the names of the clients that have been entered in the database.
It's a bit more work for you, but in the end it can prove quite usefull.
For this new form, use a SQL statement:
''INSERT* INTO tblCLIENT WHERE tblClient.name = '' & txtName.Text

Hope it helps you
 
Thank you. Yes, that is a good idea. I created a frmAddClient that is called from a cmd button from the main form. I have a txtAddClient box and a cmdAddClient button on the frmAddClient. When the user types in the txtAddClient box how do i get it into my tblCLIENT? I have an ado connection to my access database on the main form. This is what i've tried so far but it doesn't work. How would i add your sql statement. thanks for the help

Private Sub cmdAddJobNo_Click()
Dim adoJobNo As Adodc

adoJobNo.Recordset.AddNew
txtAddJobNo.Text = adoJobNo.Recordset!JobNo
adoJobNo.Recordset.Update
adoJobNo.Refresh
txtAddJobNo.SetFocus

''INSERT* INTO tblCLIENT WHERE tblClient.name = '' & txtName.Text


End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top