Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    nhdee is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    22
    Thanks but I don't want it as an unbound text box. It wouldn't work anyway. Do I have to use Open Args or is their something easier? I have tried:
    DoCmd.OpenForm "Gift Certificates", _
    WhereCondition:="Price=" & Me.GCAmt

    I get a Compile Error: Method or data member not found...

  2. #17
    nhdee is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    22
    I also tried:
    DoCmd.OpenForm "Gift Certificates", , , , , , Me.Price

    With the following:
    Private Sub Form_Load()
    If Not IsNull(Me.OpenArgs) Then
    Me.GCAmt= Me.OpenArgs
    End If
    End Sub


    Get same compile error.... ????

  3. #18
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by nhdee View Post
    Thanks but I don't want it as an unbound text box. It wouldn't work anyway....
    What are you trying to do? Are you trying to pass a value that is on a textbox on one form to another or open a form with specific criteria?

  4. #19
    nhdee is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    22
    This is a cash register database. The user enters the items being sold on the subform and IF they sell a gift certificate (selection from a combobox) it will open a gift certificate form that can be printed to give to the customer. That part is now working perfectly (see above). I am trying to take the price of the gift certificate sold, from the subform (price), and transfer it to the gift certificate form (GCAmt), which is a popup form.

  5. #20
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    If the previous form is still open, you can reference it and its controls. You don't have to use openargs

    Maybe something like this in the PopUp form's load event, as long as the form is dedicated to the OrderDetails form

    Me.Price = [Forms]![OrderDetails]![sbfOrderDetails].[Form]![Price]

  6. #21
    nhdee is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    22
    I have tried that and it doesn't work. How do I direct Access to the Price of just the Gift Certificate?

  7. #22
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by nhdee View Post
    How do I direct Access to the Price of just the Gift Certificate?
    You need to get the form and control names correct. I was just guessing on the names with the example I provided. Perhaps this can guide you to get the names correct.
    http://access.mvps.org/access/forms/frm0031.htm

  8. #23
    nhdee is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    22
    I changed what you had. The Main Form is OrderDetails. The SubForm is called SubDetails (Source Object) and the name is sbfOrderDetails. The subDetail form has a combobox called Department, and text boxes for Quantity & Price (both control source & Name are the same for everything on the subdetails form). If Gift Certificate is chosen from the department then the Gift Certificates form will open. On the Gift Certificate Form GCAmt is where I want the price from the subdetail form to go....

  9. #24
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Then this should work in your popup form's load event

    Me.GCAmt = Forms!OrderDetails!sbfOrderDetails.Form.Price

  10. #25
    nhdee is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    22
    That's what I thought and what I had used but it doesn't work. Thanks though. I am thinking I need something more specific like what I got for the recordset clone: .FindFirst "Department='Gift Certificate'" so it knows to go to the department that has gift certificate and get the price from that... not sure what to use? I know if I manually put my mouse on the Gift Certificate row in the subform to select it and have = [Forms]![OrderDetails]![sbfOrderDetails].[Form]![Price] as my default in the Gift Certificate GCAmt it WILL bring in the correct amount. But how to do that programmatically???? Something else with bookmark?

  11. #26
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by nhdee View Post
    my mouse on the Gift Certificate row in the subform to select it and have.....
    If the subform is a continuous form or a form in DS view, you need to go to that specific record. When you click on a control or record within a continuous form you set focus and, in essence, select the record. Maybe there is a way you can get the value you need into a single, unbound, textbox control or into a variable that can be passed in open args or through the form's load event.

    Before you can think about passing the value to another form, you need to isolate it somewhere. An unbound textbox may be the simplest. It may help you to visualize that the correct value is available.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Proper Use of SetFocus?
    By rpeare in forum Forms
    Replies: 14
    Last Post: 10-21-2013, 02:58 PM
  2. Requirements for SetFocus
    By EddieN1 in forum Forms
    Replies: 2
    Last Post: 09-01-2013, 06:19 PM
  3. dlook up and setfocus
    By msasan1367 in forum Access
    Replies: 3
    Last Post: 07-15-2013, 12:03 PM
  4. SetFocus after MsgBox
    By NISMOJim in forum Programming
    Replies: 18
    Last Post: 12-12-2012, 08:44 PM
  5. setfocus on an textbox different way
    By white_flag in forum Access
    Replies: 0
    Last Post: 09-21-2011, 05:04 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums