Limiting Rows By Given Number In Continuous Form (1 Viewer)

vbaInet

AWF VIP
Local time
Today, 05:08
Joined
Jan 22, 2010
Messages
26,374
Nope! It's a form event. Look at the events on the form. Remember it's a Delete action too.
 

vbaInet

AWF VIP
Local time
Today, 05:08
Joined
Jan 22, 2010
Messages
26,374
Good job but not 100%. You need to put it in the After Del Confirm event of the subform.

In the code you will need to change the reference to the form slightly. See what you can come up with.
 

vdanelia

Registered User.
Local time
Yesterday, 21:08
Joined
Jan 29, 2011
Messages
215
I never used that event before and why should to use it now?
 
Last edited:

vbaInet

AWF VIP
Local time
Today, 05:08
Joined
Jan 22, 2010
Messages
26,374
Click on the event and hit the F1 key. Read the help files about it.
 

vdanelia

Registered User.
Local time
Yesterday, 21:08
Joined
Jan 29, 2011
Messages
215
I read it carefully but nothing Important for me there
 

vbaInet

AWF VIP
Local time
Today, 05:08
Joined
Jan 22, 2010
Messages
26,374
You don't understand why you should use the After Delete Confirm event? It just means that the code will fire after the record is deleted.
 

vdanelia

Registered User.
Local time
Yesterday, 21:08
Joined
Jan 29, 2011
Messages
215
You don't understand why you should use the After Delete Confirm event? It just means that the code will fire after the record is deleted.

I know that, After Delete Confirm event occurs after the user confirms the deletions and the records are actually deleted or when the deletions are canceled...
But my problem is another thing not the deleting the records!
 

vbaInet

AWF VIP
Local time
Today, 05:08
Joined
Jan 22, 2010
Messages
26,374
Oh I see what you mean!!!!!

Is quantity bound to field? I mean is it an unbound textbox?
 

vdanelia

Registered User.
Local time
Yesterday, 21:08
Joined
Jan 29, 2011
Messages
215
Quantity is not an unbound text-box
It is bound text-box based on a table
 

vbaInet

AWF VIP
Local time
Today, 05:08
Joined
Jan 22, 2010
Messages
26,374
The question is, are you sure it should be bound?
 

vdanelia

Registered User.
Local time
Yesterday, 21:08
Joined
Jan 29, 2011
Messages
215
This is a new database, I have not the records, I'm building it and testing...
No I'm not sure :)
I can make it unbound if you suggest it.......
 

vbaInet

AWF VIP
Local time
Today, 05:08
Joined
Jan 22, 2010
Messages
26,374
Cool :)

Is the Quantity supposed to be a count of how many records are in the subform?
 

vdanelia

Registered User.
Local time
Yesterday, 21:08
Joined
Jan 29, 2011
Messages
215
Hello VbaInet
The Quantity is counting and giving me a Total Sum for example: (Unitprice * Quantity = SumAll Giving a result)
I think that it is a normal
 

vbaInet

AWF VIP
Local time
Today, 05:08
Joined
Jan 22, 2010
Messages
26,374
If the Quantity field is not directly related to your subform's recordset, I see no need to update it. It defeats the purpose of what you just achieved.
 

vdanelia

Registered User.
Local time
Yesterday, 21:08
Joined
Jan 29, 2011
Messages
215
Hello vbaInet

Here is my new test database. please check it and suggest me if something is not correct (Table normalization, relationship)

Thanks Advanced
By the way i can create a new thread for this new test database Just for suggestions
 

Attachments

  • DEMO.accdb
    984 KB · Views: 104

vbaInet

AWF VIP
Local time
Today, 05:08
Joined
Jan 22, 2010
Messages
26,374
I've just had a quick glance and I can say that you have some good normalization in place, so well done!

I will just point out two things:

1. In the Relationships I noticed you made them all OUTTER JOINs. This shouldn't be so. You should avoid Outter Joins in the Relationships window and if you need an Outter Join just do it in a query.

2. The SumAll field should not be a field in your table. It can be calculated in a query.

This is just my 2 cents ;) I don't have much time to go into too much detail.
 

vdanelia

Registered User.
Local time
Yesterday, 21:08
Joined
Jan 29, 2011
Messages
215
Thanks vbaInet for the suggestion
1. Which one to use then from join Property, 1, 2, 3
2. OK I'll Remove the SumAll from the table and will do it from query or Expression

Thank You very much for your help!
 

Users who are viewing this thread

Top Bottom