Solved

Use global variables to fill form after Adodc AddNew call

Posted on 2006-10-23
6
228 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now