473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Access XP- Changing information in a Table with a Macro

10
I want to set a macro in a database to run when someone tries to Paste Append information into my Description table. Item # is set as the primary key in this database. The macro should look at the Item # and the Status of the information to be pasted; if the Item # is going to duplicate information already existing in the form, then the macro should look at the Status of the already existing data. If the Status is blank, but the information being pasted does not have a blank Status, then the information should replace the empty cell.

Is this even a possibility? My instinct is to go with something SetValue, but I’m not sure where to go from there. I’d like to know if it’s even possible before driving myself even more batty trying to figure this out!

To make this more fun, I don’t know VB and my knowledge of macros is near zero. My last Access XP class was in 2001 and I’ve only fiddled with it a tad bit in the six years since my last class. I know how to build the tables, queries, and forms, but not much more. I’ve checked out numerous books from the library, but they don’t get as detailed as I would like; they only go over the basics, which I already know. Kind of makes you wonder why I’m even trying to build all these databases, doesn’t it?
Mar 20 '07 #1
7 1358
nico5038
3,080 Expert 2GB
When you allow people to append the data directly into the tables, than this isn't possible, as Access has no way to trigger a function when a table is updated/appended.

Only a form can work and in that case it's best to use an unbound (not linked to a table) form and have the Item# and status field entered there. With the press of a button you can trigger code to check the situation and update or add a record.

Let me know or you can handle this using only forms and we can look into that.

Nic;o)
Mar 25 '07 #2
ADezii
8,834 Expert 8TB
I want to set a macro in a database to run when someone tries to Paste Append information into my Description table. Item # is set as the primary key in this database. The macro should look at the Item # and the Status of the information to be pasted; if the Item # is going to duplicate information already existing in the form, then the macro should look at the Status of the already existing data. If the Status is blank, but the information being pasted does not have a blank Status, then the information should replace the empty cell.

Is this even a possibility? My instinct is to go with something SetValue, but I’m not sure where to go from there. I’d like to know if it’s even possible before driving myself even more batty trying to figure this out!

To make this more fun, I don’t know VB and my knowledge of macros is near zero. My last Access XP class was in 2001 and I’ve only fiddled with it a tad bit in the six years since my last class. I know how to build the tables, queries, and forms, but not much more. I’ve checked out numerous books from the library, but they don’t get as detailed as I would like; they only go over the basics, which I already know. Kind of makes you wonder why I’m even trying to build all these databases, doesn’t it?
There is a Method by which this can be accomplished:

__1. Paste Append the data into another Table (tblPasteAppend) with the exact structure of your existing Table (Table1).
__2. Create a Query linking these 2 Tables by [Item #].
__3. Change this SELECT Query to an UPDATE Query with the Criteria on the Table1![Status] Field set to Null and Update To on Table1![Status] set to tblPasteAppend![Status]
__4. This would accomplish exactly what you are requesting.
__5. You can save the UPDATE Query, but you must somehow Delete tblPasteAppend prior to each time this operation is performed.
Mar 25 '07 #3
eskara
10
Yay! Awesome :) thanks so much for that help, ADezii. It works great! I knew there had to be a solution, but I was unable to wrap my mind around it for some reason. Maybe I just need more Mountain Dew...
Mar 26 '07 #4
NeoPa
32,556 Expert Mod 16PB
__5. You can save the UPDATE Query, but you must somehow Delete tblPasteAppend prior to each time this operation is performed.
With point #5 you should consider this as Deleting (or clearing) the records from the table rather than deleting the table itself.
Mar 26 '07 #5
ADezii
8,834 Expert 8TB
Yay! Awesome :) thanks so much for that help, ADezii. It works great! I knew there had to be a solution, but I was unable to wrap my mind around it for some reason. Maybe I just need more Mountain Dew...
My answer for Mind Stimulation is Starbucks Coffee - whatever works!
Mar 26 '07 #6
ADezii
8,834 Expert 8TB
With point #5 you should consider this as Deleting (or clearing) the records from the table rather than deleting the table itself.
Much better solution.
Mar 26 '07 #7
NeoPa
32,556 Expert Mod 16PB
__1. Paste Append the data into another Table (tblPasteAppend) with the exact structure of your existing Table (Table1).
I felt I was simply clarifying your point as you already said in point #1 to Append the data in.
Mar 26 '07 #8

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

Similar topics

11
by: Mike MacSween | last post by:
My client has an MS Access database application on her local machine. I have full access to that in terms of changing the design. I've got a simple PHP/MySql application on shared hosting, so no...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
1
by: paul.hanti | last post by:
This board has been a plethora of information. Thanks to all that respond! I have a quick question regarding the built-in OutputTo macro. I've built a shared database in Access 2003 (in Access...
6
by: geronimo_me | last post by:
Hi, I am trying to run an Excel macro from an Access module, however when I run the code the macro runs but then I get an error in Access. The error is: Run-time error "440", Automation error. ...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
2
by: tonytony24 | last post by:
Hi All: I was wondering if there's a simple way to call a MS Access Module through either Command Prompt MS Script any other way... Thanks for the response.
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
6
by: simon.robin.jackson | last post by:
Ok. I need to develop a macro/vba code to do the following. There are at least 300 corrections and its expected for this to happen a lot more in the future. Therefore id like a nice...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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
jinu1996
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...
0
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
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,...

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.