Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 6th, 2007, 11:23 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

This is relevant:


================================================== =========
Read this if you want to know how to get a correct reply for your question:
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Old December 6th, 2007, 02:52 PM
Authorized User
Join Date: Dec 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

Peter and Doug,

Thanks so much!:D It works like a charm and the learning has been immense.

Hollertrek (Jon)

Old December 7th, 2007, 12:29 AM
Authorized User
Join Date: Dec 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

But I have a new problem. Prior to this present capacity to populate two Access tables, I could extract from one table (same mdb file) and fill textboxes on the form, and now I can't. I have the following code:

    Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click

        Dim intIdx As Integer
        Dim strCust As String
        Dim blnFnd As Boolean = False

        Me.txtTelephone.Text = Me.txtTelephone.Text.Replace("(", "")
        Me.txtTelephone.Text = Me.txtTelephone.Text.Replace(")", "")
        Me.txtTelephone.Text = Me.txtTelephone.Text.Replace("-", "")

        '***** Prompt for phone number
        ' strCust = InputBox("Customer Number:", "Find by Customer Number", "")
        strCust = txtTelephone.Text

        '***** Search for the Customer number

        For intIdx = 0 To (DatCust.Rows.Count - 1)
            If strCust = CStr(DatCust.Rows(intIdx)("fldTelephone")) Then
                txtTelephone.Text = (CStr(DatCust.Rows(intIdx)("fldTelephone")))
                txtName.Text = (CStr(DatCust.Rows(intIdx)("fldName")))
                txtAddress1.Text = (CStr(DatCust.Rows(intIdx)("fldAddr1")))
                'txtAddress2.Text = (CStr(DatCust.Rows(intIdx)("fldAddr2")))
                txtCity.Text = (CStr(DatCust.Rows(intIdx)("fldCity")))
                txtState.Text = (CStr(DatCust.Rows(intIdx)("fldState")))
                txtZipCode.Text = (CStr(DatCust.Rows(intIdx)("fldZip")))

                Me.txtTelephone.Text = Me.txtTelephone.Text.Insert(0, "(")
                Me.txtTelephone.Text = Me.txtTelephone.Text.Insert(4, ")")
                Me.txtTelephone.Text = Me.txtTelephone.Text.Insert(8, "-")
                Me.txtZipCode.Text = Me.txtZipCode.Text.Insert(5, "-")
                blnFnd = True

            End If
        If Not blnFnd Then
            MsgBox("Customer not found")
        End If
    End Sub

If I type a telephone number (as customer ID) in txtTelephone, it gives the "Customer not found" message, and I know it's there. Anything obvious that's wrong or is there a better approach, one that works? I don't want to be repetitive, but I've been looking through Wrox books all evening and can't find an answer.


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating tables within tables in access??? carswelljr Access 3 August 23rd, 2006 01:21 PM
Chapter 6 Selecting Data in Access ,, Help Me zaidqais BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 2 May 5th, 2006 03:48 AM
update the database when selecting a chk box ..... urindian ASP.NET 1.x and 2.0 Application Design 1 February 5th, 2005 04:39 PM
selecting records from multiple tables cygnusx04 Classic ASP Databases 1 October 28th, 2004 05:36 AM
Deleting tables in Access Database, if they exist mckly Pro VB Databases 1 August 25th, 2004 11:10 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.