microsoft access training class - move field data between
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » microsoft access training class - Move Field data between forms

microsoft access training class - Move Field data between forms

The UK's most regular instructor-led training courses.
Training information: microsoft access training class · Access course microsoft training · VBA training UK

resolvedResolved · Low Priority · Version Standard

Move Field data between forms

Jenny has attended:
Access Intermediate course
Access Advanced course
Access VBA course

by - delegate Jenny [6 posts] (2007 Aug 14 Tue, 16:42) replyReply

I Have a customer table with the Primary Key of CustID - This is an AutoNumber. A Customer can have one or pets (details stored in another table linked via CustID)

I have a form to Add a customer then a button on this form to take me to the add Pet Form, as the pet has to relate to the Customer Form i want to carry the CustId from the first form to the second form.

For example i add a customer who's CustID = 1 who has a a pet. I click the Add Pet Form and the form opens in add mode with the field CustID on. I want the CustID to be prefilled with 1, so the records are linked.


I believe i should be able to do this with an argument - but am unsure of the code

Thanks

Access Intermediate 1 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2003 2008 Sep 9 Tue Bloomsbury 3 book now £210 £215
2002/XP 2008 Sep 11 Thu Tooting 0 FULL    
2003 2008 Sep 19 Fri Bayswater 5 book now £195 £205
2007 2008 Sep 23 Tue Bloomsbury 5 book now £212 £224
2002/XP 2008 Sep 24 Wed Tooting 0 FULL    
2003 2008 Oct 7 Tue Southwark 6 book now £193 £215
Full Schedule: See all 72 Access Intermediate course dates.
Bookings currently available until 24th November 2009.

RE: Move Field data between forms

by - trainer Richard platinum contributer[788 posts] (2007 Aug 15 Wed, 09:32) replyReply

Hi Jenny

Create a macro that you will attach to the button as follows:

OpenForm
- PetForm
- Add Mode

SetValue
ITEM Field - [Forms]![Pet]![Cust]
Expression Field - [Forms]![customer]![customerId]


That shoud do it.
Also look under "SETVALUE ACTION" in the help menu. I am using Access 2003, and they give an example right at the end of exactly what you are wanting to achieve (I simplified it for you).

Let me know how you go.

Regards

Richard

RE: Move Field data between forms

by - delegate Jenny [6 posts] (2007 Aug 15 Wed, 12:24) replyReply

Thanks for the quick answer - Im not brilliant at macros ( tend to use VBA more)

I can set up the macro to open the pet form in add mode, then where do i add the

SetValue
ITEM Field - [Forms]![Pet]![Cust]
Expression Field - [Forms]![customer]![customerId]

Is this added when setting up the macro or is it added to the button or added to the field in the form??

Thanks

RE: Move Field data between forms

by - trainer Richard platinum contributer[788 posts] (2007 Aug 16 Thu, 11:50) replyReply

SetValue is a command in the macro Action column.

So the first command is OpenForm
then the next line will be Setvalue

regards

Richard


Related articles

· Turning your Spreadsheets into Interactive Data Warehouses with MS Access Courses
· Reasons to Consider Microsoft Access Training
· Want to Become the Office Hero? MS Project Training Could be the Answer
· Microsoft Access 2007: New Features
· The Benefits of Certified Microsoft Training in Access

Access tip:

Hiding Multiple Table columns

If you want to hide non-adjacent Access table columns. In Datasheet view, open the table that contains the columns you want to hide.

On the Format menu, click Unhide Columns.
In the Unhide Columns dialog box, clear the check box next to the name of each column you want to hide.
Click Close.

This method makes having to use the Hide Columns command repeatedly unnecessary

View all Access hints and tips

Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information
AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz