Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / December 2007

Tip: Looking for answers? Try searching our database.

How to send data (add a new record) via a macro?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
markmarko - 18 Dec 2007 00:17 GMT
I have to imagine it's possible to use a macro to create a new record in a
given table, and send it data. Is it possible to do this?
Ken Snell (MVP) - 18 Dec 2007 00:58 GMT
Well, yes, in a manner of speaking, it's possible. But we'll need to know
more details about the context in which you want to do this, and from where
the data come.

Are you sure you need a macro for this? Can you not use a form for this
instead?

>I have to imagine it's possible to use a macro to create a new record in a
> given table, and send it data. Is it possible to do this?
markmarko - 18 Dec 2007 01:30 GMT
Well, no, I'm not sure... I'm trying to figure this out as I go, so I'm not
well versed in methods.

Ok, here's one context (there are others, but we'll go with just this).
I have a table called SalesCodes with list all our possible sales products.
Another Table called CurrentDeals list package deals. They have package
names, then the related Sales Codes for each Package Deal is listed in that
deal's record.

Now, on the Sales Order entry form, I want the user to be able to use a
lookup to select the approprate package deal (from the CurrentDeal table).

Here's where the question comes into play... I would like the Orders Subform
to auto-populate with the appropriate Sales Codes which are associated with
that particular package deal.

Does that make sense? Basically, once the package is selected, I'd like it
to look at the record in the Current Deals table, find the appropriate Sales
Codes, and create 1 record per Sales Code in the subform.

Thank you very much!
Ken Snell (MVP) - 22 Dec 2007 16:21 GMT
I apologize..I've been out of town on business, and just got back. I'll post
a reply to this followup as soon as I can. Thanks.
Signature


       Ken Snell
<MS ACCESS MVP>

> Well, no, I'm not sure... I'm trying to figure this out as I go, so I'm
> not
> well versed in methods.
markmarko - 26 Dec 2007 22:11 GMT
Thanks, that would be appreciated.
Ken Snell (MVP) - 28 Dec 2007 22:26 GMT
So essentially you want to create order details records, one for each sales
code, when you choose a package deal value.

This can be done by adding records to the subform's Recordset, which can be
done by code or macro. The programming also would need to provide values for
any required fields in the record before it can finish adding the record and
add the next one.

You'll need to give us more details:

1) What is the table and field structure for the CurrentDeals table? How are
the separate Sales Code values stored for a single Package Deal?

2) What is the RecordSource for the subform? If it's a query, what is the
SQL statement for that query?

3) What fields are required to have a value in the subform's RecordSource
query?
Signature


       Ken Snell
<MS ACCESS MVP>

> Well, no, I'm not sure... I'm trying to figure this out as I go, so I'm
> not
[quoted text clipped - 23 lines]
>
> Thank you very much!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.