As zmbd said that there are better alternatives than the lookup field for my problem, so I create this topic to ask some questions. Firstly,I did use MVFs to be able to select items as tickbox inside dropdown combobox, so what I can do to replace MVFs with better method ?
I mean what is another way to create form with tickbox inside combobox ? Secondly, How can I query the normal table without MVFs look like a table with MVFs ?
I mean instead using table content MVFs, now, I use normal table, but query any similar thing grouped inside 1 row without drop perfomace (that method should give better perfomance than MVFs in table)
I need to use MVFs because I manage list of promotions Items.
each promotion campain have 2->20 ItemCodes, within a period time,
If I mannually write the same info for each itemcode, it'll be complex and can be misstype then information will be wrong.
If I use normal table, I can't see the group of Promotion campain as macro-picture... and normal table with 10 promotion campains can have like 200 rows, who can view all of them to manage lol
Any suggestion ?
9 1276
I don't believe that there is another way to get checkboxes in a combo box, but you can have a subform that has them. What I normally do in this case would be to have your join table not only have the two foreign keys, but also have a "Selected" field. You then use an insert query to populate the join table with all the possible promotion items (I think that is what you had in your combo box before) with the Selected field having a default value of False. Then the user can just use the checkbox to select the different promotion items for the campaign.
For querying it, you just have to have three criteria: one for each foreign key and one for the Selected field to be True.
well, so you use selected field (Boolean field) as altenative :-?
design this as subform SELECT query, then Onclick_event of "save" button set up the docmd.execute "Insert" query into table ? ==
this will take 2 step, I think performance will drop ==
I've done this many times and there is not a noticeable lag in running the insert query even with a couple hundred records getting added.
ok, so input part done
how about query it as group in 1 field :-?
my second question part lol
Okay, using the table names tblPromotionCampaign and tblCampaignItems (the join table) it would be something like this. - SELECT tblPromotionCampaign.*
-
FROM tblPromotionCampaign INNER JOIN tblCampaignItems
-
ON tblPromotionCampaign.PC_ID_pk = tblCampaignItems.PC_ID_fk
-
WHERE PI_ID_fk = 5 And Selected = True
So this looks for promotion item 5 to be selected.
@Seth Schrock:
nah, that simple query can't handle my problem.
I mean I want group those like MVFs.
Result should be Look like this:
ID ------- PCName
1,2,3 -- spring season
8,9 ----- S30
Original look like this:
ID --- PCName
1 --- spring season
2 --- spring season
3--- spring season
8 --- S30
9--- S30
I know there is a way that NeoPa gave in another post, I remember the VBA function can collect and group to like that (DAO or ADO reference)
but since VBA ADO or DAO decrease significantly perfomance I thik I should not use them when I have better solution.
Unless you know what the maximum number of IDs will be, then the only way is to use VBA. Ideally, you would limit the number of records displayed at a time. This would make the performance hit not noticeable. Allen Browne's ConcatRelated() function works great and doesn't slow down queries until you start hitting over a hundred function calls.
each PCName have fixed ID, it'll be smaller than 100 items
to know how much ID represent for PCName, I think we can count it lol.
You say "Unless" then there is a way to do it without VBA ?
I used Rabbit's Ranking Query method and then use the where clause to get a certain ranking number. However, you have to have a separate subquery for each position. So if you have up to three results, then you need three subqueries.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jim Stacey |
last post by:
Create Lookup field with Visual Basic
Can i create a lookup field on the fly? In my table Students i want to
create a loookup field
TeacherID that looks up teachers by their LastName. Otherwise...
|
by: Marco Simone |
last post by:
Hi,
What is your opinion about using Lookup field in table. I would like to use
lookup field in table 1, so that I can choose data in combo box from table
2.
Is this good design of database?
...
|
by: Zachary Turner |
last post by:
I want to make a Lookup Field based on another Lookup field. In other
words, I have this table A with two fields: ID and Name, where ID is
an Autonumber and Name is a friendly name. Then I have a...
|
by: sierra467 |
last post by:
I realize that lookup fields in a table should not be used but that is
the way this particular creator has done. Could someone help me by
answering my question.
I am trying to run a...
|
by: LurfysMa |
last post by:
I am working on an electronic flashcard program. Most of the subjects
are simple lists of questions and answers. Those seem to be working.
Some of the "subjects" have "categories" of questions.
...
|
by: samdev |
last post by:
I have set up a table with a few fields that are set to
required....all work fine except the fields that are Lookup from
another table.
What am I forgetting to set?
Thanks!!
|
by: roguetexan |
last post by:
I have over 1000 records in a table (Context_Tasks_DB), one field of which (termed Purpose) should really be a Lookup to another table (tblPurpose), but currently simply has text (only 30 unique text...
|
by: Dani |
last post by:
I'm a newbie who went ahead and designed my tables with lookup fields because I didn't know any better until I couldn't get the results I wanted in my report. I am now in on the secret--they ARE...
|
by: oharmsen |
last post by:
I want to create a different rowsource-query for a lookup field (field1) in each record in a subform.
The rowsource changes dependent on the value in another field (field2) in the same record.
How...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
|
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...
|
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...
|
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,...
| | |