Welcome to Dream.In.Code
Become a VB Expert!

Join 149,958 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,337 people online right now. Registration is fast and FREE... Join Now!




VB coding in access

 
Reply to this topicStart new topic

VB coding in access

pravs
14 Jan, 2008 - 09:11 AM
Post #1

New D.I.C Head
*

Joined: 14 Jan, 2008
Posts: 2

Hi,
am using an access database and have a table with a list of products with product number as one of the field.
The problem i have is that - on the form there is a text field which accepts product number as user input. This product number needs to be matched with multiple tables and return if there is a match found or not in the corresponding text boxes. But all this needs to happen when the user enters a product number and clicks just one button. I'am having problems returning values to the text boxes.
Please help me with this problem - i dont have a lot of background coding in VB.
Thanks!
User is offlineProfile CardPM
+Quote Post

MRJ
RE: VB Coding In Access
14 Jan, 2008 - 10:59 AM
Post #2

D.I.C Head
Group Icon

Joined: 13 Oct, 2007
Posts: 84



Thanked: 1 times
My Contributions
It would help if you posted the code that you have.

The basic process I would use would be right a query that pulls the needed data from the different tables and call it with the provided Product Number. Then populate your text boxes from the results of the query.
User is offlineProfile CardPM
+Quote Post

pravs
RE: VB Coding In Access
15 Jan, 2008 - 06:01 AM
Post #3

New D.I.C Head
*

Joined: 14 Jan, 2008
Posts: 2

Below is the event procedure that I have on the button.

On clicking the command10 button the form is opened with corresponding record matching the “CASNumber” (just like an id) which is entered by the user in the Text0 (text box). CASNumber is a user input which is compared against the field CASNumber in the table (DHSTable).
Instead of opening the form with the corresponding record if there is a match, I just want to add another text box in my form and when the user enters a “CASNumber” in text0 – text box and clicks the command button, I want this new text box to just display if it found the record or not in the table(DHSTable).

Private Sub Command10_Click()
On Error GoTo Err_Command10_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "DHSForm"

stLinkCriteria = "[CASNumber]=" & "'" & Me![Text0] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command10_Click:

Exit Sub

Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click

End Sub

Thanks a lot for your help!


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 06:11PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month