Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 17th, 2005, 02:22 PM
ItalianLodging ItalianLodging is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Italy
Posts: 9 ItalianLodging User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 36 sec
Reputation Power: 0
Angry Insert same value in multiple record

Hello !
I have the following situation:
I have a main form that controls reservations: on this main form I have a combo box from which I select
apartaments values (the names) stored in a another table (tblApt). In this main form I have then two sub forms: one for invoices and one for cleaning services. Each time I add a new reservation I get my nice blank fields and I can start adding records on
each subform just as I want to (this is to point out to you that all is related to the ReservationID). It is given that I can insert one or more invoices for each reservation and same thing is for cleaningm services.
I have an IDApt in the reservation table, the autonumber IDApt in the tblApt and I want to keep an IDApt numeric field in the cleaning table too because I also need to control the adding and deleting of cleaning services independently by the mentioned mainform (I might create anothe rform just for cleaning services). I also would need it for cleaning reports for each apartment.

I would like from this main form automatically insert the value of the apartment in the cleaning service IDApt field subform for each cleaning service I have for that given reservation (Say I have 3 cleanings for that reservation). I select the apt from the main form and it sets the same value in the subform for each cleaning chosen.

I have accomplished the easy part of inserting the name on the first record in this way:
Code:
Private Sub cboApt_AfterUpdate()
 
		 Form_subMaskPulizie.IDApt = Me.cboApt
		Form_subMaskPulizie.Refresh
 
End Sub


I have had a similar problem recently working on a similar issue. With the same reservationID I had two invoices:
deposit and balance. I was calculating the amount form the main form. I was able to insert the value
I wanted to add to the Deposit but I didn't know how access the following record related by the ReservationID.

What I am not getting is how to get my hands on the single records. I seem to get control of one record but no more.
I think Iwells showed me the path once but I am still not getting. I thank you in advance.

Reply With Quote
  #2  
Old January 18th, 2005, 12:42 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
ItalianLodging

I really got lost in trying to understand your table relationships and your question. Which table is the one and which table is the many? From what I can tell, it would be just a matter of setting up relationships between your cleaning table and your apartment table and that would automatically add the aptID, but not following your table relationships it's hard to tell for sure. If you already have it structured that way, are the Master/Child Link fields between your subforms and main form set up? Or have I misunderstood your question all together?

lwells

Reply With Quote
  #3  
Old January 19th, 2005, 04:57 AM
ItalianLodging ItalianLodging is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Italy
Posts: 9 ItalianLodging User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 36 sec
Reputation Power: 0
Insert same value in multiple record

Hello Iwells
I have attached a sample DB sorry if I haven't been too precise.
Attached Files
File Type: zip test.zip (64.9 KB, 179 views)

Reply With Quote
  #4  
Old January 19th, 2005, 02:03 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Hi ItalianLodging,

Take a look at the database and see if this is what you were looking for. I made the field IDApt default to the IDApt selected in the main form. I also set the Enabled to No and Locked to Yes so that no changes can be made to the IDApt in the subform.

I changed the relationships slightly and setup another column in your invoices to show the balance due after a payment was made. So as a payment is made the remaining balance will show on the form automatically. I also changed the two buttons to calculate the downpayment and remaining balance based on the new column.

I added a field to the tblApt for the Rental Amount. I wasn't sure if the rental amount is something that is fixed or negotiated, so you will have to decide if this can be used. If it is negotiated, then you will probably need to change things back to the way they were, and add a field in your tblReservations to hold the amount that is negotiated. Then change where the calculations take their values to the this field instead of the tblApt like I have it set now to calculate correctly with the negotiated amount rather than the fixed amount. Or you can add another field to the reservation table and set the control to default what was in the tblApt Rental Amount. Then you have a suggested rental amount based on the table tblApt, and a field to enter what the negotiated amount was (if different) so that you have both displayed at the same time on your form.

lwells
Attached Files
File Type: zip test.zip (42.5 KB, 218 views)

Last edited by lwells : January 19th, 2005 at 02:11 PM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Insert same value in multiple record


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT