"Neil" wrote in message news:jnp3f3$ebd$(E-Mail Removed)...
>Like, right now, I'm creating a record in a table, and need to insert the
>date value from a text box on a form into a field of that table. That seems
>to be impossible to do.
>
it is quite easy.
And as a side note anyone here ever use SQL server and write code for those
store procedures?
No debugger, and it is a rather lousy language.
However, I been busy and was sick today. So I shall make a short post.
I would love to tell one of my favorite "war" stories about how when came
over to Access from having used FoxPro for many years. Us FoxPro people
could not believe how stupid it was that Access did not have record numbers!
I mean, data written out to a table ALWAYS maintained the order. Having
written systems in Pascal, in FORTRAN, FoxPro, dBase and many others, they
all had record numbers and order of data written out was always maintained.
Heck writing data out to a comma delimited text file ALSO maintained order.
All of sudden years of that type of thinking had to be tossed out when I
adopted Access.
So why would such a simple thing now become so difficult with Access? Of
course the issue is as our industry moved towards a more abstracted out
database system, and farther and farther way from punch cards and the actual
file system on the disk drive, then these abstractions meant that the idea
of order of data inside a database table and that of using record numbers
simply were not appropriate designs for the needs of the industry and they
actually became not useful concepts in the Data Processing industry anymore.
In other words simple code designs that wrote data out to a table in a
particular order had to be tossed out. All of the designs and methodology
and things had been using for years all the sudden also had to be tossed
out.
At the end of the day it's an architecture change.
Anyway, I only have a bit of time here, so while I'd love to wax eloquent
about the FoxPro methodology change in which I had to go through when I
started uses Access, but let me just post an answer here.
>All I want to do is insert a value from a text box into record field when
>I create a record using a data macro. Is that possible?
Sure. No problem. And this does not matter if it is a bound form, or not.
Here is a data macro in which I want to create a child record A invoice
record, and I want to PASS the customer ID (the parent record PK) to this
routine that will create a new child record for me.
The code that does this is this:
https://public.sn2.livefilestore.com...ce1.png?psid=1
Note the use of a parameter to pass the value form the form. Also note how
the above RETURNS BACK the new ID of the record just created (I need that in
the form's code that calls the data macro).
The form code while not important, is this :
https://public.sn2.livefilestore.com...ata.png?psid=1
Note how the above references a sub form, checks for a invoice or checks if
the current invoice date is NOT this month, then we call (and pass) the
value of the customer ID to the data macro. The data macro creates a new
invoice record, and RETURNS that PK value back to the calling form code of
what the new record ID was created.
So in above example:
I pass a value to a data macro from a form. The data macro creates a new
record in a table, and then as noted returns the PK value. You might not
need to return values, but the above code snips shows how this works anyway.
Just remember, if the value you grab is a un-bound text box and it suppose
to be a number value, then set the format of the text box to general number.
--
Albert D. Kallal
Edmonton, Alberta Canada
(E-Mail Removed)