473,432 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,432 software developers and data experts.

Programaticaly populate a sub-form

Hello all,

I'm using A97 on W2K.

I've got a form, say "frmMain" which contains a sub form, say
"frmMainSub". This sub form is a "continue mode" style form (traducted
from french. don't know the exact term in english). So I can add,
remove, modify records "live".

What I must do (asked by the boss!!), it's to use another form, say
"frmChoice", which would give users the possibility to select one or
more record from a fixed number of records, to populate afterward
frmMainSub, by clicking checkboxes. This form is more "graphical" and
visual and fast for the user than entering each line in frmMainSub.
But, I've to run the "frmMainSub.AfterInsert" function after inserting
these record programaticaly because some updates are done.

Right now, I've achieved all that. I added a button on frmMain which
open dialog frmChoice and I retreive selected data. Then (all from
frmMain module):
1- I add the first record to the table source of frmMainSub.
2- I requery frmMainSub.
3- I FindFirst the added record.
4- I run frmMainSub.AfterInsert (wich update a couple of fields
directly in frmMainSub. For some reasons, I don't want to just
cut&paste this code and run it in an update query in frmMain module.)
5- I run DoCmd.RunCommand acCmdSaveRecord
6- I redo all this with the second selected choice, ... third, ....

But, it looks like point #5 do not work. I end up with frmMainSub
populated with lines added but not updated (as if point #4 did
nothing). Except for the last inserted line which as been updated
(visualy in frmMainSub) but not in the table source.

Anybody has solution to this situation. Other suggestion to acheive
this similarly.

Thanks for your time.

Yannick

Dec 6 '05 #1
1 1242
Problem solved.

For those who will face the same situation, I added a Requery call at
the end of frmMainSub.AfterInsert.I don't know why it was needed but it
works. I realise that point #5 was in fact at the end of the function
in point #4. And I added the Requery call after the SaveRecord command.

1- I add the first record to the table source of frmMainSub.
2- I requery frmMainSub.
3- I FindFirst the added record.
4- I run frmMainSub.AfterInsert (wich update a couple of fields
directly in frmMainSub. For some reasons, I don't want to just
cut&paste this code and run it in an update query in frmMain module.)
5- I run DoCmd.RunCommand acCmdSaveRecord
6- I redo all this with the second selected choice, ... third, ....

Dec 6 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Sharon | last post by:
I have successfully loaded a DataSet object with a XML schema (XSD). Now I wish to populate the tables that was created in the DataSet. I have an XML file/string that contain all the needed data...
3
by: crjunk | last post by:
I have 4 different databases that I'm having to pull data from in order to populate a datagrid. I am able to do this, but my problem is that because I'm pulling the data from 4 different...
1
by: gbraux | last post by:
Hello, I am dealing with security zones in Internet Explorer. I know how to add websites programaticaly to the intranet zone (using IInternetSecurityManager::SetZoneMapping). But do anyone...
1
by: indhu | last post by:
Hi all, I want 2 know, how to populate using 2 combo box to populate other field. right now am using click event of combo to populate the other field but i want to select both combo1 and combo2 ...
1
by: wradyn | last post by:
As an example, my MySQL database has 3 tables: main-area, sub-area, and items. Using PHP I populate my first select-list as follows: <?php // Create list containing the Main Areas echo "Select...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.