473,417 Members | 1,409 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,417 software developers and data experts.

Current Record query from subform not working help!!

58 32bit
i created an append query in which i need current to be append into another table.
SQL
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO PaidFeeT ( FacultyPaid, MonthYearPaid, SecurityFeePaid, AdmissionFeePaid, TotalFeePaid, SR )
  2. SELECT FeeT.Faculty, FeeT.MonthYear, FeeT.Security, FeeT.AdmissionFee, FeeT.TotalFee, FeeT.ID
  3. FROM FeeT
  4. WHERE (((FeeT.SR)=[forms]![FeeTF]![SR]));
from the form its working but from subform its not working it showing enter parameter. see image

Apr 2 '21 #1

✓ answered by cactusdata

That could be something like:

Expand|Select|Wrap|Line Numbers
  1. Dim Source  As DAO.Recordset
  2. Dim Target  As DAO.Recordset
  3.  
  4. Set Source = Me!NameOfYourSubformControlHoldingFeeT.Form.RecordsetClone
  5. Set Target = Me!NameOfYourSubformControlHoldingPaidFeeT.Form.RecordsetClone
  6.  
  7. Source.FindFirst "SR = " & Me!NameOfYourSubformControlHoldingFeeT.Form!SR.Value
  8. If Not Source.NoMatch Then
  9.     Target.AddNew
  10.         Target!FacultyPaid.Value = Source!Faculty.Value
  11.         Target!MonthYearPaid.Value = Source!MonthYear.Value
  12.         Target!SecurityFeePaid.Value = Source!Security.Value
  13.         Target!AdmissionFeePaid.Value = Source!AdmissionFee.Value
  14.         Target!TotalFeePaid.Value = Source!TotalFee.Value
  15.         Target!SR.Value = Source!ID.Value
  16.     Target.Update
  17. End If
  18. Target.Close
  19. Source.Close

14 6784
cactusdata
214 Expert 128KB
Try with:

Expand|Select|Wrap|Line Numbers
  1. WHERE FeeT.SR=[Forms]![FeeTF].[Form]![SR];
But it would be much simpler to open the RecordsetClone of the subform as a recordset, and then use AddNew to insert the record. It would even update the subform automagically.
Apr 3 '21 #2
ZKAHADI
58 32bit
how should i do this? clone record
Apr 5 '21 #3
cactusdata
214 Expert 128KB
That could be something like:

Expand|Select|Wrap|Line Numbers
  1. Dim Source  As DAO.Recordset
  2. Dim Target  As DAO.Recordset
  3.  
  4. Set Source = Me!NameOfYourSubformControlHoldingFeeT.Form.RecordsetClone
  5. Set Target = Me!NameOfYourSubformControlHoldingPaidFeeT.Form.RecordsetClone
  6.  
  7. Source.FindFirst "SR = " & Me!NameOfYourSubformControlHoldingFeeT.Form!SR.Value
  8. If Not Source.NoMatch Then
  9.     Target.AddNew
  10.         Target!FacultyPaid.Value = Source!Faculty.Value
  11.         Target!MonthYearPaid.Value = Source!MonthYear.Value
  12.         Target!SecurityFeePaid.Value = Source!Security.Value
  13.         Target!AdmissionFeePaid.Value = Source!AdmissionFee.Value
  14.         Target!TotalFeePaid.Value = Source!TotalFee.Value
  15.         Target!SR.Value = Source!ID.Value
  16.     Target.Update
  17. End If
  18. Target.Close
  19. Source.Close
Apr 5 '21 #4
isladogs
456 Expert Mod 256MB
For info, the OP has since cross posted this same thread at another forum
Apr 7 '21 #5
NeoPa
32,556 Expert Mod 16PB
Well, what you get out of something is generally related to what you put in. The answer's there if they want to work on understanding it. If not then they'll have the same problems wherever they go.

We (Bytes.com) have a question and an answer and that gives value, both to the site and any others who are interested in similar questions.

To be fair, there's no reason why members shouldn't be members elsewhere too. We just need to ensure our answers are as good as they can find - or at least as good as we can make them. I suspect we do a decent job in that respect from the feedback I've heard.

Well done to all of you for providing those answers :-)

PS. I just read the linked link. I have to say I accept much of what Ken says and agree with it. I'm a little ambivalent about some of his suggestions but nothing majorly. Many of our best experts post cross-sites and that's great. Not all do though.
Apr 7 '21 #6
isladogs
456 Expert Mod 256MB
AFAIAC its fine to post the same question at more than one forum PROVIDING the OP has the courtesy to say that he/she has done so and provide the link(s) to the other thread(s).
However doing so without providing that information wastes everyone's time...at each of the forums
Apr 7 '21 #7
NeoPa
32,556 Expert Mod 16PB
I would agree with that - with the proviso that any such links don't break the rules of the site you're posting on.

I haven't seen any public announcement yet but I'm certainly aware Niheel (Owner) is planning to relax such restrictions here pretty soon.
Apr 8 '21 #8
ZKAHADI
58 32bit
is there any problem if someone get any satisfied answer from this or other form? i think its not a religious form where i ask any solution from one religion and another.
Apr 10 '21 #9
cactusdata
214 Expert 128KB
No. I've also posted questions in two fora that were marginal to the core expertise of these fora.

But, when a solution is found, it should be referred to in the other forum/fora, as no forum like abandoned questions.
The trouble, that may prevent you from this, is that some fora doesn't allow links to other fora as these are seen as competitors (which I've never understood as no two fora have the some focus).
If so, you should copy the full solution to the other fora.
Apr 10 '21 #10
isladogs
456 Expert Mod 256MB
@Zhakadi
The fact that you asked the question in post #9 suggests you didn't read the link I provided at the other forum.
So I'll provide it again here: A message to forum cross posters.
Apr 10 '21 #11
NeoPa
32,556 Expert Mod 16PB
ZKAHADI:
is there any problem if someone get any satisfied answer from this or other form? i think its not a religious form where i ask any solution from one religion and another.
I'm sorry that you don't understand why your behaviour is considered to be selfish and disrespectful. Nevertheless that is the case.

Those that struggle to understand are generally people who have no difficulty with the idea of letting others do their work for them and struggle with any concept of responsibility.

It's unfortunate, but doesn't break site rules. Thus we don't take action against such behaviour or members that exhibit it. However, you should be aware that experts everywhere are generally the least dim people, so recognise such behaviour and tend to steer clear of such members when it comes to the time when their expertise is required.

You may just find, when you behave in a disrespectful way to those you rely on to help you, that nobody wants to waste their time on your questions.
Apr 11 '21 #12
ZKAHADI
58 32bit
i am a learner and i want to learn everywhere. i am not disrespect, i respect all of you because i am as student and your are as teacher. but in search of a batter answer i post my problem on every form.

i am really sorry if you or anybody hurt.
Apr 12 '21 #13
NeoPa
32,556 Expert Mod 16PB
It may be also that you struggle to understand because you're trying to work in a foreign language. We should allow you some leeway for that. It's easy to forget how hard that can be for those of us that don't need to - and even for those who have to do so but are more practised at it (Some of our experts are not native English speakers either).

So, we understand that you are behaving well as you see it. Please follow the link (A message to forum cross posters) posted by IslaDogs earlier and try to understand how you can post in multiple forums without upsetting people.
Apr 12 '21 #14
ZKAHADI
58 32bit
i apologize about that but you can see my english also weak. i cant properly speak english. may be my method to talk is not good. but i respect all of you.
Apr 13 '21 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Maria | last post by:
Is there another way to delete the current record in a subform from the main form, another subform or a sub-subform other than setting focus on a field in the subform and using run command...
2
by: Melissa | last post by:
I have a single (not continuous) form with an Undo button for entering finished projects. On the form is also a subform that lists all finished projects for reference. When I enter the...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
1
by: Reginald Bal | last post by:
Main Form/SubForm When I requery or recalc my parent form after I updated a record in my subform, I lose the focus of that particular record in my subform. Instead, the first record is selected....
5
by: 130975 | last post by:
Hi, I am working on a database. I have created a main form and three linked forms. When I enter an ID in the main form all the related information is also displayed on the linked forms. The problem...
0
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I am running Access 2007. I have a report that I want to filter. I can go into Advanced...Advanced Filter/Sort... and setup a filter that works fine on the report when I apply it. When in this...
0
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I am running Access 2007. I have a report that I want to filter. I can go into Advanced...Advanced Filter/Sort... and setup a filter that works fine on the report when I apply it. When in this...
2
by: michael george | last post by:
Hi, I am a recreational user of access and I enjoy making small databases. My question is when I add records to a form i want to create a report on the form currently displayed on screen, at the...
5
by: Redbeard | last post by:
I am working with Access 2007. I am trying to print a report from the current record on a Subform. My form is comprised of a Main form with a sub-form and another sub-form with in the sub-form. ...
9
by: behedwin | last post by:
Hey I need some help to solve a problem with creating a new record. i have uploaded my project in both 2016 and 2003 version of access! Please view the zip file where both files are. to...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.