Page 4 of 4 FirstFirst 1234
Results 46 to 54 of 54
  1. #46
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28

    Again an Issue!!!

    Hi Paul,


    It's time to bother you.

    I am creating a excel file from access and writing data in it.

    This works fine but I am unable to append the data to an already existing file. And also, i am unable to open the same fiel using VBA.

    I have attached sample code for your reference.

    Thanks in advance,
    Ram

  2. #47
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The way to open an existing file:

    objXL.Workbooks.Open (strFile)

    Not sure what you mean about not being able to open it, as it's open. To display it try

    objXL.Display

    Though I tend to save it and close all my objects and then open the file with FollowHyperlink, so that I don't have any hanging processes in Access.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #48
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28

    How to append data...

    Thanks for the reply Paul!!


    But, my another question was how to append the data to an existing file.

    Please help!!!


    Thanks,
    Ram

  4. #49
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Here's a trick I use often when I'm not sure how to do something in Excel automation. Open an Excel file and record a macro that performs the action you want (in your case, I'd imagine an "End-Home" to find the bottom of the sheet). Then look in the code editor at the code that was created. It often requires a little tweaking to work from Access, but it should get you on the right track.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #50
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28
    Hi Paul,
    Another question to bother you!!!

    I have one form and a related sub-form in the same page.

    I have used the properties Link Child field and Link Master field with a common field (WD_ID).

    Now, when i opened this access form and before I enter a value in the WD_ID field in the master form, i am getting errors saying that

    The sub form field cannot contain the Null Value. something like that.

    How can i avoid this eror?

    I am attaching the screenshot.


    Thanks in advance,
    Ram

  6. #51
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is the value the 4445? If so, that should have been carried down to the subform via the master/child links. If not, is focus going to the subform first?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #52
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28

    A quick question

    Hi Paul,
    Good afternoon!!

    I have quick question.

    I have a form and a sub form. When i click on one of the fields in this sub form, it will open another form as dialog box.

    User enter the rates and hours in this pop up form and closes.

    What I want is when the user enter the hours and rates in this pop up and closes, the sub form should be automatically refreshed with the product of hours and rates.

    Can we do that?

    Please help!!!

  8. #53
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Since the second form is opened in dialog mode, no code will run in the first until it's closed or hidden. You have two options I can see: use code in the second to place the desired value in the first form before it closes, or hide the second instead of closing it, and let code in the first grab the desired value and then close the second.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #54
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28
    Hi Paul,
    Can you provide me with a litttle bit of Code, if possible?

    I am not able to understand it clearly.

    Thanks,
    Ram

Page 4 of 4 FirstFirst 1234
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Tabular Form
    By Evgeny in forum Forms
    Replies: 0
    Last Post: 04-26-2010, 08:39 PM
  2. Remove items from Tabular Form
    By JoshS in forum Forms
    Replies: 3
    Last Post: 04-26-2010, 02:18 PM
  3. Positioning Tabular Labels
    By rod147 in forum Forms
    Replies: 6
    Last Post: 07-06-2009, 11:02 AM
  4. tabular forms - setting values per each record
    By Daytona675 in forum Forms
    Replies: 0
    Last Post: 11-25-2008, 09:43 AM
  5. Design help
    By marix in forum Database Design
    Replies: 1
    Last Post: 04-18-2007, 07:54 AM

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