473,509 Members | 10,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select multiple records on continuous form

PhilOfWalton
1,430 Recognized Expert Top Contributor
I have a continuous form showing expenditure transactions, broken down into what the money was spent on.



In the underlying table there is a "TransID" AutoNumber, a "TransNo" which generally is the next number up unless there is a combined transaction in which case they are the same, and a "Combined" - Yes/No

In the case of the 2 transactions dated 13th November, this was a single visit to a supermarket where food costing £25.74 was bought and £50 cashback. I want to show this as a single amount of -£75.74 in the transaction column as per this picture.
At the moment I am doing this manually by ticking the “Combined” column and changing the “Trans No” to the same value.

It’s messy because I do checks in the AfterUpdate that if the Combined is set to true there must be more than one transaction and also a check that the Trans Nos are the same.
What I want to do is select both records (highlighted – as if I were going to delete them) and apply the setting Combined = True and setting the Trans No to the first number of the group by pressing a command button.
So, has anyone got an elegant solution storing the relevant transaction IDs

Interestingly, if on the OnCurrent, I do a Debug.Print TransID, and highlight a number of records, it only prints the first record in the series.

Phil
Nov 17 '16 #1
3 2749
jforbes
1,107 Recognized Expert Top Contributor
I'm not sure the Combined Column is getting you much. That might be because I don't fully understand its purpose. If it is just to identify that a record is part of a combined transaction, then I would change the field from a Boolean to an Integer and call it something like SubTrans. That way you would basically have a Compound Key with the TransNo and SubTrans:
Expand|Select|Wrap|Line Numbers
  1. 13/11/2016 1715 1 Cash Withdrawl
  2. 13/11/2016 1715 2 Food & Drink
  3. 14/11/2016 1716 1 Banco Santander(Abbey)
  4. 15/11/2016 1717 1 Domestic & General(Fridge)
By doing something like this, you can do a couple things to make data entry easier
  • Defaulting the SubTrans based on what is entered into the TransNo Field, in the AfterUpdate Event. So when a duplicate TransNo is entered, the next available SubTrans is found and populated into the SubTrans.
  • You could also create the SubTrans Field as a ComboBox with the numbers 1 through 20, to make it easer than having to type the value in, if it is even needed. People like to use their mouse.

If you do something like this, you don't need to do anything elaborate. If you still would like to explore options, that's cool also.
Nov 17 '16 #2
PhilOfWalton
1,430 Recognized Expert Top Contributor
Spot on, thanks.
What I will do is set the default value of SubTrans to 1, then if I alter a subsequent TransNo to the previous TransNo, it would automatically increment the second SubTrans.

Many thanks for a simple solution

Phil
Nov 17 '16 #3
jforbes
1,107 Recognized Expert Top Contributor
I'm glad I could help!
Nov 18 '16 #4

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

Similar topics

1
3526
by: Dave | last post by:
I am building an invoicing database. I have no problems searching for due dates and generating the invoice header. The problem is generating the invoice detail. My customers may have more than...
1
4731
by: andree | last post by:
Hello, I have a form where a user may paste multiple records. The form has an AfterInsert procedure. The procedure copies the newly inserted record into a different table for audit purposes. ...
4
3155
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
3
3704
by: Leo | last post by:
Hi everybody, Is there a way to fill a continuous form with an ADO recordset? Normally when I populate the form with the recordset only the first record is shown. I want to fill all records....
4
2244
dima69
by: dima69 | last post by:
Is it possible to select multiple records on datasheet via code ? Using SelTop and SelHeight properties dosn't give the same result as selecting the records manually, since record selectors remain...
1
1451
by: marylipscomb | last post by:
I have a form that has a place to enter Adjacent Properties, which I only have room for like 6 right now to be entered.. Sometimes their could be 100 entries. Where you enter that info on the...
2
989
by: code4knowledge | last post by:
Hi! Is there a way to have a user select more than one record from a gridview? Thanks to all for the helping hand!!!! code4knowledge!!!
5
3177
by: Nhoung Ar | last post by:
I am working on small database, which has a number of thousand records in one table. I need to print those (a hundred records or less) a time. I think that i should have one form for input the...
2
3767
by: Ian Anderson | last post by:
Hello there, SO i have the followign VB code in my continuous form... 'Purpose: This module illustrates how to create a search form, _ where the user can enter as many or few...
6
12808
by: mcupito | last post by:
I'd like to list the multiple records on the form. I'll attach images because it's just easier that way. On the form, instead of the row selector, I'd like it to just list the different Totals. I...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7347
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
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5656
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,...
1
5062
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...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.