I have a mainform that has a subform in the detail section and a subform in the footer section.(Both subforms are in datasheet view) When I click the navigation button to create a new record on the mainform. My subform in the detail section goes blank (this is what I want) but my subform in the footer section appears to have the data from the previous record displayed. When you click on the subform the data dissapears and displays blank. If I go back one record on the main form and return to the newly created record then the subform is blank. What I would like is to just have the subform show blank when I create the new main form record.
I am unsure if it has anything to do with it, but I have some code that autofills my main form with data from the previous record, but the subform is not included in that code at all.
If needed I can include a screen shot of what I mean if that will help.
I don't know what I would have done without this forum, you guys ROCK !!!!!
7 3331
I have a mainform that has a subform in the detail section and a subform in the footer section.(Both subforms are in datasheet view) When I click the navigation button to create a new record on the mainform. My subform in the detail section goes blank (this is what I want) but my subform in the footer section appears to have the data from the previous record displayed. When you click on the subform the data dissapears and displays blank. If I go back one record on the main form and return to the newly created record then the subform is blank. What I would like is to just have the subform show blank when I create the new main form record.
I am unsure if it has anything to do with it, but I have some code that autofills my main form with data from the previous record, but the subform is not included in that code at all.
If needed I can include a screen shot of what I mean if that will help.
I don't know what I would have done without this forum, you guys ROCK !!!!!
Have you tried requerying that subform, something like - Private Sub Form_Current()
-
Me![SubFRM].Requery
-
End Sub
I tried this, but got error that it could not find the field ( I assume [subFRM] is meant as the name of my subform)
I then tried to use Forms!AlertPersonnelSubFRM.Requery put me in infinite loop. (In on current event of AlertPersonnelSubFRM)
I then tried in the on current event of my main form and i still see the display of the information associated to the main forms last record. Again the data is not actuallty there as when you click the subform it returns to an empty datasheetview.
Any other suggestions are welcome
Thanks
I tried this, but got error that it could not find the field ( I assume [subFRM] is meant as the name of my subform)
I then tried to use Forms!AlertPersonnelSubFRM.Requery put me in infinite loop. (In on current event of AlertPersonnelSubFRM)
I then tried in the on current event of my main form and i still see the display of the information associated to the main forms last record. Again the data is not actuallty there as when you click the subform it returns to an empty datasheetview.
Any other suggestions are welcome
Thanks
Your syntax for the requery appears to be incorrect. It should be:
Forms!YourMainForm!YourSubformControl.Requery
Replace the above with the actual names used in your application.
I am unsure what is meant by subform control. My subform has two fields and is displayed in data sheet view. The two fields are Name (textfield) and Standby(checkbox).
Do you mean the name of the subform?
Sorry for needing you to supersimplify, i assumed that control was like a textbox etc.
Thanks,
Chris
I am unsure what is meant by subform control. My subform has two fields and is displayed in data sheet view. The two fields are Name (textfield) and Standby(checkbox).
Do you mean the name of the subform?
Sorry for needing you to supersimplify, i assumed that control was like a textbox etc.
Thanks,
Chris
The subform control is the name of the "container" for the subform on the Main form. The subform is the form inside the container. If you click on the border between the form and subform you will invoke the property sheet for the subform container that holds the subform.. The first property is the subform container control's name property, and the second property listed says Source Object. Source Object is the name of the subform inside the subform container. Frequently, the subform container and the subform itself have the same name,but not always>>>>>and you need the name of the container for your requery..
Thanks for the insight. I was unaware that the container even existed. I checked the name and it was different. I still have the subform display data from previous main form record. - Private Sub Form_Current()
-
Call AutoFillNewRecord(Forms!Alert)
-
[Forms]![Alert]![AlertPersonnelSubform].Requery
-
End Sub
I have taken some screens of the form that depicts what is happening, as well as what I would like to happen. How do I post the images, if you think they might help?
Thanks
I got it too work, maybe not the most elegant way, but...
All I did was in the current event of my main form I set the focus to my subform and then back to my main form and voila, no ghosted data.
I don't understand why the ghosted data showed up in the first place, but it is gone now.
Thanks to all who tried to help. It is greatly appreciated.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Arnold |
last post by:
Hi there,
I have a form to organize bottles in mind, but am unsure if it will
work. Here's some background info:
Mainform = frmProduct, which contains fields for pricing, status, etc.
of...
|
by: Bob |
last post by:
Hi Everybody
I have a form called frmListBox that is connected to a table tblListBox.
This is opened from a form called "frmInvoiceOrder" which has a subform called "zfrmInvoiceOrder"
and...
|
by: Susan Bricker |
last post by:
Greetings. I have a Mainform with a subform. The Mainform has single
record format and subform has continuous form format. When the Mainform
opens, I force allowadditions and allowedits to FALSE...
|
by: ricky.agrawal |
last post by:
I'm really not sure how to go about this in Access. What I've created
is a table for each location. Those tables are identical in format but
different in information.
The tables are named after...
|
by: planetthoughtful |
last post by:
Hi All,
I have a mainform with a subform in which I show some task summary
data.
On the mainform I have a number of unbound controls that reflect values
relevant to each task in the subform....
|
by: google |
last post by:
I have a form with several subforms. Users enter the data, then on the
parent there is a command button that runs code to generate a .pdf
document from a report based on the data they are working...
|
by: angi35 |
last post by:
I hope this is an easy question for someone out there. In Access 2000…I have a MainForm with a tab control (MAIN TABS) with 7 tabs.
Within each tab is a SubForm.
Within each SubForm is a tab...
|
by: postman |
last post by:
Any idea why code would work as intended when setting a breakpoint and stepping through it line by line, but won't work correctly at run-time?
The code is too much to post, so I hope this summary...
|
by: reginaldmerritt |
last post by:
I have a few forms which i have designed to be subforms to a mainform that has no fields or record source.
The forms have an unbound textbox and combo box, which i use to seach the data on these...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: lllomh |
last post by:
How does React native implement an English player?
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| | |