Click here to Skip to main content
15,903,201 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: problem in creating downloader Pin
jdcodes1-May-09 20:30
jdcodes1-May-09 20:30 
GeneralRe: problem in creating downloader Pin
Dave Kreskowiak2-May-09 4:28
mveDave Kreskowiak2-May-09 4:28 
GeneralRe: problem in creating downloader Pin
jdcodes4-May-09 10:16
jdcodes4-May-09 10:16 
GeneralRe: problem in creating downloader Pin
Dave Kreskowiak4-May-09 17:13
mveDave Kreskowiak4-May-09 17:13 
QuestionProblem passing/filling/editing data Pin
smjunior091-May-09 7:59
smjunior091-May-09 7:59 
AnswerRe: Problem passing/filling/editing data Pin
Kschuler1-May-09 10:46
Kschuler1-May-09 10:46 
AnswerRe: Problem passing/filling/editing data Pin
Mycroft Holmes1-May-09 15:10
professionalMycroft Holmes1-May-09 15:10 
GeneralRe: Problem passing/filling/editing data Pin
smjunior091-May-09 16:53
smjunior091-May-09 16:53 
First off, thank you both very much for you responses. I know this is super mundane for you but I appreciate the help like you can't believe. Try to answer both posts with this. Basics is this, I am a mortgage lender, I work with real estate agents, we have a new lead generation system in place. Want to be able to record and report data back to them on what is taking place. Tables are Agent(recording specific agents info) property (linking descriptions to certain props and referencing specific agents to that prop) and Caller(keeping info on the people calling in)

The code I originally posted is located in my main form. I am using the showdialog as part of a new form loaded when someone wants to do something. This code you saw is written into my main form. In Mycroft's comments I know that is the problem, the last part about updating the parent form once I send info into the DB. Can't really figure out what I am doing wrong though. In regard to Kschuler's comments, here is the code I use to update the record once it is passed in(again through the main form when someone selects update an agent), what I cant figure out is why I cant start the program, add an agent, then turn around and update the record. If the program shuts down, starts up again, my code functions perfectly. If I try to do it all at the same time the error comes back telling me that my edit function is trying to add a new agent. Even though the code returns a value that specifies what agent I am trying to update. Variable selected agent is = the one I want to select, but the program thinks I am trying to add a new agent. This probably also has to do with another problem I am encountering when I databind a listbox to my agents first and/or last name and once I move away from the first agent listed, that agent disappears in the list box.
Private Sub upagent()
        Dim myagentup As New Agentup

        Dim result As DialogResult
        result = myagentup.ShowDialog

        If result = Windows.Forms.DialogResult.OK Then
            Dim selectedagent
            selectedagent = myagentup.TextBox1.Text

            Dim agent As HVDataSet.AgentRow
            agent = myHVDataSet.Agent.FindByAgentID(selectedagent)

            agent.BeginEdit()
            agent.Agent_Address = myagentup.agentaddress
            agent.Agent_City = myagentup.agentscity
            agent.Agent_Company = myagentup.agentcompany
            agent.Agent_Email = myagentup.agentemail
            agent.Agent_First = myagentup.agentfirst
            agent.Agent_Last = myagentup.agentlast
            agent.Agent_Phone = myagentup.agentphone
            agent.Agent_State = myagentup.agentstate
            agent.Agent_Web = myagentup.agentwebsite
            agent.Agent_Zip = myagentup.agentzip
            agent.EndEdit()

            Dim rowsaffected As Integer = 0
            rowsaffected = AgentTableAdapter.Update(agent)

            If rowsaffected > 0 Then
                ToolStripStatusLabel1.Text = "Updated record for Agent: " & myagentup.agentfirst
            Else
                MessageBox.Show("We were unable to process the request you gave, please try again.")
            End If
        End If

        myagentup = Nothing
    End Sub

GeneralRe: Problem passing/filling/editing data Pin
smjunior091-May-09 16:56
smjunior091-May-09 16:56 
QuestionGetting content of word embedded in Web Browser control Pin
42ka11-May-09 3:35
42ka11-May-09 3:35 
AnswerRe: Getting content of word embedded in Web Browser control Pin
Dave Kreskowiak1-May-09 3:55
mveDave Kreskowiak1-May-09 3:55 
Questionopening balance in access database using crystal report Pin
adnanbilwani1-May-09 2:30
adnanbilwani1-May-09 2:30 
AnswerRe: opening balance in access database using crystal report Pin
Dave Kreskowiak1-May-09 3:54
mveDave Kreskowiak1-May-09 3:54 
QuestionFor Each Textbox Pin
Samir Ibrahim1-May-09 2:21
Samir Ibrahim1-May-09 2:21 
AnswerRe: For Each Textbox Pin
Henry Minute1-May-09 2:29
Henry Minute1-May-09 2:29 
GeneralRe: For Each Textbox Pin
Samir Ibrahim1-May-09 3:07
Samir Ibrahim1-May-09 3:07 
AnswerRe: For Each Textbox Pin
Mycroft Holmes1-May-09 2:33
professionalMycroft Holmes1-May-09 2:33 
GeneralRe: For Each Textbox Pin
Samir Ibrahim1-May-09 3:23
Samir Ibrahim1-May-09 3:23 
NewsRe: For Each Textbox Pin
Samir Ibrahim1-May-09 4:02
Samir Ibrahim1-May-09 4:02 
GeneralRe: For Each Textbox Pin
Mycroft Holmes1-May-09 15:11
professionalMycroft Holmes1-May-09 15:11 
QuestionData Report Pin
Jimnahsh1-May-09 0:19
Jimnahsh1-May-09 0:19 
AnswerRe: Data Report Pin
Dalek Dave1-May-09 1:23
professionalDalek Dave1-May-09 1:23 
AnswerRe: Data Report Pin
Ashfield1-May-09 1:24
Ashfield1-May-09 1:24 
GeneralRe: Data Report Pin
Jimnahsh17-May-09 5:13
Jimnahsh17-May-09 5:13 
GeneralRe: Data Report Pin
Ashfield17-May-09 11:12
Ashfield17-May-09 11:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.