Solved

Use global variables to fill form after Adodc AddNew call

Posted on 2006-10-23
6
233 Views
Last Modified: 2010-04-30
     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
Comment
Question by:CopperNose
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:lunchbyte
ID: 17795661
Are you using databound method?

0
 

Author Comment

by:CopperNose
ID: 17797682
  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
 
LVL 5

Accepted Solution

by:
lunchbyte earned 250 total points
ID: 17798466
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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:CopperNose
ID: 17799797
   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
 
LVL 5

Expert Comment

by:lunchbyte
ID: 17802473
Sometime talking with another programmer makes you realize something. I been there so no worry. Thanks for the points anyway.
0
 

Author Comment

by:CopperNose
ID: 17802716
     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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question