Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 13th, 2008, 08:56 AM
Friend of Wrox
 
Join Date: Apr 2007
Location: , , .
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default Subject: use the Form property to refer to a form

Hi All

I trying to find solution to this

When button_1 clicked

it must sets price of specific item in a sub form specific row using
following code
Forms(formA)(formB)!Price.SetFocus

But it always set prices of first row of formB instead of setting price for
3rd or 4th row of sub form

so Is there anyway I can set set focus to
formA > subform (formB) > row (2) in subform

I did find this article but it didn't help to that level

http://msdn.microsoft.com/en-us/library/aa195905(office.11).aspx


Reply With Quote
  #2 (permalink)  
Old May 13th, 2008, 02:11 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You didn't mention what type of sub form this is. If it is a continuous form, then the answer is no.

Can you post more info?

mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #3 (permalink)  
Old May 14th, 2008, 03:28 AM
Friend of Wrox
 
Join Date: Apr 2007
Location: , , .
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default

This subform A is continous form,and display number of purchased items in sales order.
This subform Ahas price box text field when cursor is at this textbox and pressing F5, it display another form C which displays price list and user can pick price from that form by click Paste price. and Price will appear on subform A price box.
But problem is it always paste price in very first row of continous form instead of setting price for 2nd or any other row

Reply With Quote
  #4 (permalink)  
Old May 14th, 2008, 10:37 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Some more questions:

Do you want this to be the default price in subsequent rows as they are created, or just to rows already created in the subform? It sounds like you want this price to be reflected in every row, but I am not sure if the rows are created yet.



mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #5 (permalink)  
Old May 16th, 2008, 07:49 AM
Friend of Wrox
 
Join Date: Apr 2007
Location: , , .
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default

Top Here is Main Order form
----------------------------------------------This is continous Sub form-----------------------------------
Item No Item Name Item Decrciption Item Quantity Item Currency Item Price Item Despatch Date
 1 XXX Technical Part 10 £ 1.1(*Here you press F5)16/05/08
 2 XXX Technical part 5 $ 2.1(*Here you press F5 again to get price for this item) 17/03/09
 3 New Line New Line New Line New Line New Line
* when we press F5 subfrom pops up and click button to paste price to Item Price field




Reply With Quote
  #6 (permalink)  
Old May 19th, 2008, 04:39 AM
Friend of Wrox
 
Join Date: Apr 2007
Location: , , .
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default

In Access 2007 the F5 key executes a data refresh of the form.

Therefore when you press F5 the currentrecord in the subform is reset due to the data refresh.

To solve this you need to cancel the data refresh as follows:

Wherever you have the code in for F5

If KeyCode = 116 Then 'Do Something ------------

Replace with

Private Sub Price_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 116 Then
    'Do something
    KeyCode = 0
End If
------

I hope this will help others encounter same issue


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the BackColor property of a Form Qman69 Visual Basic 2005 Basics 0 March 14th, 2007 04:43 PM
splash form property changes problem Derek_05 Access VBA 1 January 17th, 2006 10:54 AM
how to refer another form khautinh General .NET 2 March 17th, 2004 01:29 PM
Form TopMost property shadowpug VB.NET 2002/2003 Basics 1 September 3rd, 2003 11:39 PM
refer to list box on another form timbal25 Access 2 August 5th, 2003 07:05 AM



All times are GMT -4. The time now is 10:55 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.