470,810 Members | 1,001 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

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 6285
cactusdata
200 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
200 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
357 Expert Mod 256MB
For info, the OP has since cross posted this same thread at another forum
Apr 7 '21 #5
NeoPa
32,311 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
357 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,311 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
200 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
357 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,311 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,311 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

Post your reply

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

Similar topics

reply views Thread by Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post: by
reply views Thread by Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.