Solved

Use global variables to fill form after Adodc AddNew call

Posted on 2006-10-23
6
226 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

760 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

20 Experts available now in Live!

Get 1:1 Help Now