User Profile

Collapse

Profile Sidebar

Collapse
greeni91
greeni91
Last Activity: Mar 30 '15, 06:08 PM
Joined: Nov 26 '09
Location: MB Aerospace (Motherwell)
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I had a little play around with my database before my break and I think I have solved my own problem. The code provided above works just as well but this is the final revision of the code I used on the database.

    Code:
    Private Sub cmdPrint_Click()
    Dim appexcel As Object
    Dim MyFile As String
    
    Set appexcel = CreateObject("Excel.Application")
    MyFile = Me.PR_Number
    
    DoCmd.PrintOut acSelection
    ...
    See more | Go to post

    Leave a comment:


  • I am running this code from an Access database using VBA with the hope of controlling an Excel spreadsheet to some degree.
    See more | Go to post

    Leave a comment:


  • greeni91
    started a topic How to print all sheets in Excel from Access VBA

    How to print all sheets in Excel from Access VBA

    I have a database that I am currently upgrading and I am having just one small problem.

    I have a button on a form that, when clicked, will print out the Current Form and print an Excel Document based on my current report number.

    The problem I am having is that when the Workbook is open it may have more than one sheet that I wish to printout. I have used this code below:

    Code:
    Private Sub cmdPrint_Click()
    ...
    See more | Go to post

  • greeni91
    started a topic Union Query with Count Function

    Union Query with Count Function

    Hi,

    I am currently trying to create a report that list all the Features that have been checked and the metrology used to check said feature.

    I have created a UNION query that will combine the fields used in my form into one column in a query. The problem I face is that if there are any duplicates in my UNION query they are combined but I do not know how many times that combination has appeared.

    I am needing...
    See more | Go to post

  • Thanks guys,

    I have followed NeoPa's way of writing the code and it is working perfect now.

    Here is a copy of the working code for reference:

    Code:
    Private Sub cmdSave_Click()
    
    Dim strSQL As String
    Dim Fixt As Variant, Op As Variant
    Dim Prt As String
    
    
    Fixt = Me.FixtureNumber
    Prt = Me.ChoosenParts_subform!Part
    Op = Me.ChoosenParts_subform!Operation
    ...
    See more | Go to post

    Leave a comment:


  • How to copy data from a Subform to a table using VBA

    I am currently in the process of remaking a database that was created a long time ago. I have hit a bit of a snag when it comes to using subforms.

    I have a main form called "New Fixtures"

    In this form I have one field called "Fixture"

    I also have one subform called "ChoosenParts_s ubform"

    In the subform I have 2 fields called "Part" and "Operation"...
    See more | Go to post

  • Sorry for the delay in the reply

    Yes I am currently using Access Security. I have created my own security (.ldb) file with indivdual user accounts and passwords to try and prevent this sort of thing from happening. I am starting to consider the possibility that I may have set the security file wrong, but I am sure I would have had problems before this...

    Thanks

    Sandy
    See more | Go to post

    Leave a comment:


  • How to show Access Database Window to only Admin Users

    Hi There,

    I have created a database that has been implemented in our workshop for over a year now and this is our first problem... actually quite a biggie in my mind.

    One of the users in the workshop has been tinkering with parts of the database and has caused me a lot of hastle. I have tried deleting his account but keep getting errors, I have made sure that deletions are not allowed, I have set his account to the lowest...
    See more | Go to post

  • Hi Again,

    I am using this code on a different form for Repairs in my database now and I am getting a Run-Time Error '3134': syntax error in INSERT INTO statement.

    I have checked my code against that which NeoPa provided me above and everything seems to be okay but it constantly returns this same error... can someone please help??

    The code I have made is:
    Code:
    Private Sub cmdLog_Click()
         Dim
    ...
    See more | Go to post

    Leave a comment:


  • greeni91
    started a topic How to query using today's date?

    How to query using today's date?

    Hi All,

    I have been working on a database for a few weeks now and I have hit a bit of a snag.

    I have to make a set of reports detailing which machines need maintenance in the upcoming month. I have setup the report but I need to apply a filter of some sort, Query?, to show only the machines needing done in this month.

    The field I need to search is called M Next Date and the format of the field is Date/Time...
    See more | Go to post

  • Yes I do mean unentered values,

    I would say whatever is easiest but my choice is Nulls

    /Sandy
    See more | Go to post

    Leave a comment:


  • Yes that is what I mean, you see all my controls are locked till a specific date and they can be completed early if need be.

    So if they click the complete button I will update the table without a name and without any notes.

    The way the code is written just now means that it will not allow me to append my information to the table because there is: "improper use of Null value"

    /Sandy
    See more | Go to post

    Leave a comment:


  • Thanks NeoPa,

    Everything is working okay with the code but I was wondering if you could rephrase the last section:

    Code:
    #         strSQL = Replace(strSQL, "%S", .cboPersonnel1)
    #         strSQL = Replace(strSQL, "%T", .txtNote1)
    I need to have these so that it allows for Null values.

    sorry I didn't mention it before,

    Thanks Again,

    /Sandy
    See more | Go to post

    Leave a comment:


  • How to copy Information to a new record on a different table

    Hi All,

    I am in the middle of creating a database for maintenance scheduling and I have hit a bit of a brick wall.

    I have a main form that will be used to say when and what maintenance activities have been done, but I am trying to copy some of that information to another table when I click on my command button.

    This is how far I have got with the code... I need help trying to word the code to add the information...
    See more | Go to post

  • greeni91
    replied to How to Enable/Disable fields based on Date
    Sorry Guys,

    I screwed up when putting in the OnLoad() event, when I typed out the private sub I wrote it as _OnLoad(). Now that the event has the right name the code works perfect... I am following it as NeoPa suggested in his last post.

    Thanks a lot guys... I still have some hair left, haha

    /Sandy
    See more | Go to post

    Leave a comment:


  • greeni91
    replied to How to Enable/Disable fields based on Date
    Thanks for the help guys,

    I have tried both methods but neither of them give me the results I am looking for. I have put the code in the OnLoad() property as there is one record per machine, so when that record loads it will lock all appropriate checks for me.

    I have noticed in the past that you usually need the code in another property as well, say an AfterUpdate() property, I will play around with these a little bit to...
    See more | Go to post

    Leave a comment:


  • greeni91
    started a topic How to Enable/Disable fields based on Date

    How to Enable/Disable fields based on Date

    Hi There,

    I am making a database that is for a Maintenance Schedule. I am having a problem when it comes to locking the fields I don't need to see at this time.

    I have a main date at the top of my form (txtDate) that displays today's date using the function =Date()

    Next I have a date for the next Maintenance scheduled on a machine (txtNextDate).

    What I am trying to do is lock the fields...
    See more | Go to post

  • greeni91
    replied to How to link Drawings in Access 2003
    I tried to upload the database but Bytes.com said it is an invalid file extension... Could you give me an email address to send the database to you. Send it to me in a private email please so your addess isn't posted on the thread.

    /Sandy
    See more | Go to post

    Leave a comment:


  • greeni91
    replied to How to link Drawings in Access 2003
    Yes I already have this code entered, but I have entered it to the Command button on the main form. Would this explain the problem??

    The code is as follows:

    Code:
      
    Private Sub Drawing_Click()
    DoCmd.OpenForm "Drawing", acNormal, , , acFormEdit, acWindowNormal, Me![PartNo]
    End Sub
    I am using this Command button to open the 2nd form and thought that was where you wanted the code.......
    See more | Go to post

    Leave a comment:


  • greeni91
    replied to How to link Drawings in Access 2003
    What do you mean.... I only used both pieces of code that you gave me and that's all.

    I don't think I have anything passing my OpenArgs value. The only thing is the code above that has OpenArgs mentioned in it....
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...