[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

Use global variables to fill form after Adodc AddNew call

     Application with two forms.  Main Data and Assistance Data. Main data only has one entry for each applicant. Assistance can have any number of entrys of each applicant in the Main Data. When I get a request from a applicant I check my main data to verify they are in data base or I enter their SSN and data at that time. I want to be able to save the data such as first and last names, address etc as global variables when selected in main form. I then call the Assistance form and issue a AddNew call. Form of course clears as it should but I haven't figured away to make it take the global variables to fill the approprate text boxes. I did it with DBASE, FoxPlus 2.6 and Visual FoxPro but haven't coaxed Visual Basic 6 into doing it for me.
  I've just taken up Visual Basic in the last couple of years just to learn something new. Been programming since DOS 1 and Vulcan, just trying to teach a 77 year old geek some new tricks. I know it's real simple, just can't see it. Any ideas.
      CopperNose
0
CopperNose
Asked:
CopperNose
  • 3
  • 3
1 Solution
 
lunchbyteCommented:
Are you using databound method?

0
 
CopperNoseAuthor Commented:
  I assume my answer is Yes since both forms have all their text boxes, mask edit boxes, etc bound to the form ADODC control on that form. The approach I have allways used in the past is as follows.
  When I need to add a applicant to the Assist form I must verify that I have them in my Main Database. I check it for the SSN. If it there I load my variables for the names, address, phone etc. If they are not in Main Database I enter them there at this time and then fill the variables.
    I then return to my Assist form, invoke my AddNew Call and fill the fields with the global variables. The fields clear out as they should but I'm not getting the variables loaded into the blank form.
    I'm trying to load them in the code just after the AddNew Call and the fields clear, this might be the problem. Hope this gives better idea of what I'm doing.
     Thanks, Coppernose


0
 
lunchbyteCommented:
Oh I see, you are trying to reload the data back into the blank form from a variable instead of database, correct?

If so, have you consider just re-query that record to re-populate the fields on the form?


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
CopperNoseAuthor Commented:
   lunchbyte,
       I know you are going to want to kick me good, but it was just a stupid mistake on my part. I was just trying to load my variables in the wrong place. When it finnaly dawned one me and moved my code it works just like it should in the older programs I had written in prior years. I had been trying to solve it for a couply of weeks, but that is the price old programmers pay. Thanks for all your time and patience.   You deserve the points for hanging in there with me.
    CopperNose
0
 
lunchbyteCommented:
Sometime talking with another programmer makes you realize something. I been there so no worry. Thanks for the points anyway.
0
 
CopperNoseAuthor Commented:
     Fact is your comment is what caused me to find the mistake. I dropped the procedure in the code from my library and I knew it would work because I have used it for years in other code. When you suggested a re-query might work I went to looking just where to implement it. That is when I saw I had put the code in the wrong place, so really you solved the problem.  Thanks,  CopperNose
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now