473,465 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to Edit Multivalued Fields

9 New Member
Hi,

I want to know if there is a way to edit a multivalued field?

please teach me how

thanks

PLEASE SEE ATTACH SAMPLE FILE
Attached Files
File Type: zip SAMPLE.zip (17.9 KB, 218 views)
Feb 14 '14 #1
5 5519
ADezii
8,834 Recognized Expert Expert
This is a little more complicated then you may think. Using your Attached DB, and updating all occurrences of 'Bridge Cable' to 'RX157 Cable' in the [Description] Multi-value Field, the procedure would be:
  1. Create a Recordset on the Detail Table.
  2. Loop through all Records in the Detail Table via the Recordset.
  3. For each Unique [ID], create another Child Recordset based on all the Values [Description] for this Multi-value Field.
  4. Loop through these [Description] Records, and for each one that contains the text 'Bridge Cable' replace it with RX157 Cable.
  5. If a Record in any Multi-value Field contains this text, place the Parent Recordset and Child Recordsets in Edit Mode.
  6. Make the changes.
  7. Update both Recordsets.
  8. Do your Clean Up Chores!
  9. Requery the Form.
    Expand|Select|Wrap|Line Numbers
    1. Dim db As DAO.Database
    2. Dim rst As DAO.Recordset
    3. Dim rstComplex As DAO.Recordset2
    4.  
    5. Set db = CurrentDb
    6.  
    7. 'Open a Recordset on the Detail Table
    8. Set rst = db.OpenRecordset("SELECT * FROM Detail", dbOpenDynaset)
    9.   'Loop through all the Records
    10.   Do Until rst.EOF
    11.     'Get the Description Type Complex Field
    12.     Set rstComplex = rst!Description.Value
    13.       'Loop through all Description Complex Data Type Values
    14.       Do Until rstComplex.EOF
    15.         'Does Bridge Cable appear in the Description Field?
    16.         If InStr(rstComplex.Fields(0), "Bridge Cable") > 0 Then
    17.           'Wherever 'Bridge Cable' appears, Replace it with RX157 Cable
    18.           rst.Edit      'Parent Recordset must be in Edit Mode
    19.             rstComplex.Edit
    20.               rstComplex.Fields(0) = Replace(rstComplex.Fields(0), _
    21.                                      "Bridge Cable", "RX157 Cable")
    22.             rstComplex.Update
    23.           rst.Update
    24.         End If
    25.           rstComplex.MoveNext
    26.       Loop
    27.         rst.MoveNext
    28.   Loop
    29.  
    30. Me.Requery
    31.  
    32. 'Clean up chores
    33. rst.Close
    34. Set rst = Nothing
    35. Set rstComplex = Nothing
    36. Set db = Nothing
    37.  
  10. I do realize that this is a lot to absorb, so if there are any questions, please feel free to ask.
Feb 14 '14 #2
yuanmiguel
9 New Member
Hi ADezii,

Thanks for the reply..
kind a hard to absorb..
can you do that in my attached db.

Thank you so much
Feb 17 '14 #3
zmbd
5,501 Recognized Expert Moderator Expert
@yuanmiguel:
ADezii, has provided you with a very reasonable and generous amount of his time and knowledge. Certainly as much as I would have done if I were not so buried at work these past months. (^_^)

At this point, please make the attempt to do the work yourself.

It does you no good to have ADezii, myself, or anyone else here do your work for you - we try to "teach you how to fish" not "give you the fish" ...

If you are still having issues after following ADezii's example, please post back with the details.
Feb 17 '14 #4
yuanmiguel
9 New Member
hi zmbd,

I'm sorry for that.
I know what you mean.Thank you for that.
I am a newbees in ms access/programmer.
It's easy for me to learn if i have some example to look up.
That's why i ask Adezii to try at my sample db.

Again sorry for the interpretation.
Feb 18 '14 #5
zmbd
5,501 Recognized Expert Moderator Expert
No worries yuanmiguel.

Ah, yes, we've all started there and the better the examples we have to work with, often the easier it is to grab on to the tool. In this case, ADezii has provided a hammer with the safety grip and teather so that it should be easy enough for even a novice, with some work, to be able to adapt to the project at hand. (^_^)

It is ultimately up to ADezii how much help is provided and quite often ADezii is "generous to a fault" and as such is well loved and respected here by many, including myself, for the amount of help provided. Hence my request that you attempt to work thru what has already been provided - sometimes, one simply needs to stand-up and put that foot forward and go-fo-it!

If you have any problems following ADezii's example within your database, post back with the details.



(oh, and BTW, this is one reason to avoid the MVF unless you are having to post to a sharepoint site. There is nothing to be gained using MVF that can not be obtained within a properly normalized database. > Database Normalization and Table Structures. )
Feb 18 '14 #6

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

Similar topics

0
by: allyn44 | last post by:
HI--I have 2 tables Cut: cut ID, HistNumb, Block, date: Cut Id is the primary key, the other 3 fileds are indexed to be unique Slides: Cutid SlideID, and various other fields: there can be...
0
by: Kumar | last post by:
Hi Folks, I am trying to do the following functionality. Add employee ID in OtherHomePhone field in that user Active directory profile. I created DirectoryEntry object. While assiging the...
2
by: mukeshhtrivedi | last post by:
I have Cost Analysis form created where there are three fileds and I want to have total of all the fileds at the end. I have created text box which has Control Source as =++. It shows me total of...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
8
by: Tradeorganizer | last post by:
Hi, I have a database with table name as test in that i have 6 colums they are name varchar (20) address varchar (20) position varchar (20) nametype1 varchar (20) nametype2 varchar (20)
1
by: Paul | last post by:
Hi, I have an entry, called UserIDs. It is a multivalue entry (the new type from Access 2007). The entries look like 1; 5; 332; 28 3; 1; 557; 2; 47 However when I try to retrieve it using...
1
by: Mientje | last post by:
I've made an Access 2007 database to store information about the lessonplans I have to make every schoolyear. I want to export the data form the table "Lesvoorbereiding" (Lessonplans in English) to...
1
by: hbludau | last post by:
I use a number of multivalued lists - I am tracking the status of documents and they can have multiple statuses at the same time so this is limiting the number of fields I need. However, I want to...
3
by: impin | last post by:
I am creating table in mysql using php.. i want store all the details from the resume... name,email,address, phone, etc........ for example if the candidate is experienced then only he should fill...
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
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...
0
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...
1
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
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
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.