468,107 Members | 1,456 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Current Record query from subform not working help!!

56 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

1 Week Ago #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

11 1915
cactusdata
161 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.
1 Week Ago #2
ZKAHADI
56 32bit
how should i do this? clone record
6 Days Ago #3
cactusdata
161 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
6 Days Ago #4
isladogs
224 Expert 128KB
For info, the OP has since cross posted this same thread at another forum
4 Days Ago #5
NeoPa
32,021 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.
4 Days Ago #6
isladogs
224 Expert 128KB
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
4 Days Ago #7
NeoPa
32,021 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.
4 Days Ago #8
ZKAHADI
56 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.
1 Days ago #9
cactusdata
161 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.
1 Days ago #10
isladogs
224 Expert 128KB
@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.
1 Days ago #11
NeoPa
32,021 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.
1 Days ago #12

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
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.