473,407 Members | 2,315 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,407 software developers and data experts.

Table or Form problem

20
I have two tables:
CustInfo (main table with all customer info)
CustPay (History table for payments received)

They are linked as from Custinfo by field TblCustPay Lookup to TblCustPay field ID (autonumber)

I made a query with the fields from CustInfo :
ID
Name
Addr
Lst_Pay
Bal_Amt

and with fields from CustPay:
ChkNum (need appended to custpay tbl)
ChkAmt (need appended to custpay tbl)
RecDate (need appended to custpay tbl AND updated to Lst_Pay in custinfo tbl)
Then I need to update Bal_Amt (custinfo tbl) minus ChkAmt from the input value

Then I made a form with all these fields from the query
Can navigate through the records from Custinfo but nothing changes in the fields from CustPay.
Also, I entered data and it placed it in the first record of CustPay tbl the first time only.

I have tried various samples of code editing and editing.
I now have a migraine trying to figure this out.

Any guidance is greatly appreciated.
Jan 26 '08 #1
15 1331
NeoPa
32,556 Expert Mod 16PB
My first thought would be to check if it's an updatable query. If not - that could cause you various problems.
If you find it is, it might then help if we had your SQL to look at for the query.
Jan 26 '08 #2
booboo
20
The query the form is built from ? It is set as update type.
I believe I need a query or procedure that takes the form data and puts it in the tables. Correct ?
If so, that is what I don't have and need some guidance on what is involved in it. I think. But can one query / do all I need done, I suppose as an after_event ?code
Jan 26 '08 #3
NeoPa
32,556 Expert Mod 16PB
...
Then I made a form with all these fields from the query
...
What you say makes little sense to me.
You don't seem to have made any intelligible response to my post so I have no way to proceed with this.
Jan 26 '08 #4
booboo
20
I did a query based on the tables and selected only the above fields from each table in the query. Then I built a form based entirely on that query.
I don't know how to explain it any other way.

Apparently, just building a form from a query built from tables is not enough for the changes / inputs made in the form to do anything with the existing tables ?
Jan 27 '08 #5
NeoPa
32,556 Expert Mod 16PB
My first thought would be to check if it's an updatable query. If not - that could cause you various problems.
If you find it is, it might then help if we had your SQL to look at for the query.
Is it an updatable query?
If it is post your SQL.

Answer question then follow instruction.
NB. Don't expect me to follow you on your tangents if you can't respond to my post.
Jan 27 '08 #6
booboo
20
Expand|Select|Wrap|Line Numbers
  1. Update query =
  2.  
  3. INSERT INTO TblPayInfo ( ID, CHKNUM, RECDATE, CHKAMT )
  4. SELECT TblCustInfo.ID, TblPayInfo.CHKNUM, TblPayInfo.RECDATE, TblPayInfo.CHKAMT
  5. FROM TblPayInfo INNER JOIN TblCustInfo ON TblPayInfo.ID = TblCustInfo.TblPayInfo_ID;
Expand|Select|Wrap|Line Numbers
  1. Append query =
  2.  
  3. UPDATE TblPayInfo INNER JOIN TblCustInfo ON TblPayInfo.ID = TblCustInfo.TblPayInfo_ID SET
  4. SET TblCustInfo.LST_PAY = [RECDATE], TblCustInfo.BAL_AMT = [Bal_Amt]-[CHKAMT];
Jan 27 '08 #7
booboo
20
Assuming these are correct and will do what I need, is there a way to combine the two to do both in the same routine then reset the form for the next record ?
Jan 27 '08 #8
NeoPa
32,556 Expert Mod 16PB
Is it an updatable query?
If it is post your SQL.

Answer question then follow instruction.
NB. Don't expect me to follow you on your tangents if you can't respond to my post.
Is this an answer to "Is it an updatable query?" Only indirectly. I can guess it's not, as you have posted two non-SELECT queries.

As it's not - why have you posted the SQL?

Please note my earlier NB. You're not responding to my question but going off at tangents again. I would like to help, but it's increasingly difficult if you don't opay any attention to what I'm saying.

Let's start again.

Your first post mentions building a form on a query where two tables are connected. This is the query I'm talking about. I need to understand what's what from that perspective.
Jan 27 '08 #9
booboo
20
Ok, I made a query, which is a SELECT query just to build a form with. (Since someone told me, on here I believe), that all forms should be built from a query.

This is that query:
Expand|Select|Wrap|Line Numbers
  1. SELECT TblCustInfo.ID, TblCustInfo.NAME, TblCustInfo.ADDR, TblCustInfo.LST_PAY, TblCustInfo.BAL_AMT, TblPayInfo.CHKNUM, TblPayInfo.RECDATE, TblPayInfo.CHKAMT
  2. FROM TblPayInfo INNER JOIN TblCustInfo ON TblPayInfo.ID = TblCustInfo.TblPayInfo_ID
  3. ORDER BY TblCustInfo.NAME;
Jan 27 '08 #10
NeoPa
32,556 Expert Mod 16PB
Well, we're getting somewhere now. Still a fair way to go before we have the question though.
Is it updatable? (I think I've asked this one a few times already.)

Your original post suggests that the two tables are linked in the query, but it's unclear what it means (what it actually says can't be true - guessing what it means is harder).
I have two tables:
CustInfo (main table with all customer info)
CustPay (History table for payments received)

They are linked as from Custinfo by field TblCustPay Lookup to TblCustPay field ID (autonumber)
...
The reason this is important is that I can't see that the two tables (from their names) can sensibly link in any other way than CustInfo (One) to CustPay (Many). Oh gracious. I've just checked and the table names aren't even the same ones. How can I make any sense of this?
Assuming then, that what you refer to as CustInfo is actually TblCustInfo and the same with CustPay and TblPayInfo, how can TblCustInfo have a TblPayInfo_ID field?

I know there are a number of questions in here, principally because you've ignored the questions from previous posts. I should explain that if the questions are not all answered this time, or an explanation given for why, I will give up on this thread.
Jan 27 '08 #11
booboo
20
Yes, you are correct.
I have been trying different ways through different db's to get this to work. Obviously, I called the table two different names in my attempts. Sorry about the confusion.
I will continue to try to work this out.
Sorry to take up your time with my 'Tangents'.
Jan 27 '08 #12
booboo
20
Well I actually got it working, sort of. It does insert the data but returns an error that I can't figure out. I redid the whole db, and as you can see, names have changed. My code for AfterUpdate is:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_AfterUpdate()
  2. 'Appends payment info to history'
  3.  
  4. INSERT INTO(TblPay.CHKNUM, TblPay.RECDATE, TblPay.PAY_AMT, TblPay.BAL_AMT)
  5. WHERE (TblPay.BAL_AMT = ([BAL_AMT] - [PAY_AMT]))
  6.  
  7. End Sub
I changed the tables so that I am only doing an append and to only one table.
The error I get is:
"The expression AfterUpdate you entered as the event property setting produced the following error: Procedure declaration does not match description of event or procedure having the same name."

I've tried adding the FrmPay name in the (), and various other things but....
Any help ?
Jan 27 '08 #13
NeoPa
32,556 Expert Mod 16PB
I'm sorry.
I don't know what makes it so difficult for you to answer simple questions, but clearly this is not as easy for you as I think it should be.
Still my questions remain unanswered. Still you want to go off on tangents.
From my perspective, you've taken a wrong approach here and tried to reprogram the part that Access should be doing. Access should be handling the updating of the data within the form automatically.
How can I possibly explain this to you though? And how to go about doing it correctly? You ignore almost everything I say.

All I can say is good luck. I hope you find some help with your problems.
Jan 27 '08 #14
booboo
20
I'm sorry.
I don't know what makes it so difficult for you to answer simple questions, but clearly this is not as easy for you as I think it should be.
Still my questions remain unanswered. Still you want to go off on tangents.
From my perspective, you've taken a wrong approach here and tried to reprogram the part that Access should be doing. Access should be handling the updating of the data within the form automatically.
How can I possibly explain this to you though? And how to go about doing it correctly? You ignore almost everything I say.

All I can say is good luck. I hope you find some help with your problems.
I haven't ignored what you have said because virtually all you have said has been inferences of my lack of knowledge and the 'tangents' as you so like to use.
From my perspective, you have made no effort to even understand what I have said since everything is not explained exactly as you wish.
Yes, I hope someone can help but my bet is you have killed this thread from anyone attempting to do so.
If I knew all I need to know to build this, I wouldn't be on here asking for help.
Jan 27 '08 #15
NeoPa
32,556 Expert Mod 16PB
I'm sorry you feel that way.
I would like to make clear though, that I have not in any way disparaged your lack of knowledge in this thread (feel free to reread it). If I had a problem with anybody's lack of knowledge I'd be pretty stupid to spend so much time here.

My problems have consistently been with your inability to respond to what I post. This seems to imply a lack of respect when dealing with others that you expect to help you.
If I can just quote from your own last post :
From my perspective, you have made no effort to even understand what I have said since everything is not explained exactly as you wish.
You seem to feel it is our job to make the effort to understand your problem, regardless of how little effort you put in to explaining it clearly or even bothering to reply to questions from people trying to help. Multiple posts referring to the same objects but by different names is just one example of your unhelpful style. I think you were given ample opportunity to correct this but it all seems too much effort for you. You prefer to blame others for your own problems.

I can ask others to have a look at your problem if you like, but I should warn you that most of our experts will probably want to steer well clear of you after reading what you've posted in this thread. I'll leave it up to you. Let me know if you'd like me to.
Jan 28 '08 #16

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

Similar topics

25
by: kie | last post by:
hello, i have a table that creates and deletes rows dynamically using createElement, appendChild, removeChild. when i have added the required amount of rows and input my data, i would like to...
8
by: L Major | last post by:
Hi Unfortunately, I am limited to using tables for part of my current project. I have a form that spans across a number of TR and TD in the shape of checkboxes. Doctype is XHTML 1.0...
2
by: Asad | last post by:
I have a form on a page that has several textareas, and textboxes inside a table (so the table containing the textboxes is also inside the FORM tag). I want to replace the textareas with simple...
3
by: VanIkyn | last post by:
Hello peoples, This is a last resort, as I've run out of search strings I can think of for this problem. There may very well be a simple and logical solution that I have overlooked. Thanks in...
4
by: Laura | last post by:
Here's the situation: I'm trying to use an update query to copy data from one row to another. Here is the situation: I have 5 companies that are linked to each other. I need to show all 5...
7
by: Amirallia | last post by:
Hello! I have a wecontrol table in a page, this table has a number of variable rows depending of the choice of the user. But when the table has a large number of rows, the printing of the page...
3
by: Al Wilkerson | last post by:
Hey, I have a Web Form with a drop down list, textbox, and search button. When click the search button an SQL server database is queried fordata. Once I have the data in a dataset I use the...
4
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc.,...
3
by: blakerrr | last post by:
Hi All, I have a strange situation that I can't figure out. The task is quite simple, delete a record from a table. Here is my situation: I have a form called Order Create which cycles through...
4
by: jbrumbau | last post by:
Hello, I have been successfully using a database I've created for several months to populate an equipment list for a project we've been working on. However, the form has recently stopped working...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
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
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...

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.