Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 53
  1. #16
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28

    ok here is the link.

    http://www.freewebtown.com/stratis/Database.zip

  2. #17
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Can you not just stick the relevent items in a new mdb and post that?

    David

  3. #18
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    ok i did it really fast.I hope it works.

    The frmMain is the main form and the frmClients is the form i have the problem.
    Last edited by viper550; 11-06-2009 at 04:22 PM.

  4. #19
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Lots of issues.

    Corruption in form

    See form 1

    You are usiing the dreaded lookups in your table
    take out and simply store the client id as a long integer

    this works now.

    David

  5. #20
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    My god this works indeed.I almost broke my pc from frustration.

    Now that i can choose from the second combo box how can i open a specific excel file for each selection of the second combo box?And one more question.Will i be able to do the same if i have a form with one combo box and one button?(i want to use this combination in some other form i will use).

  6. #21
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Where does the Excel file come into the equasion?
    What do you want do do with the files?

    David

  7. #22
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    Well why would i need a combo box and a button if i wasn't going to do something with them???

    I want each time i make a selection from the combo box when i press a button i want it to open an excel file.Not inside the form somewhere.I just want it to open microsoft excel with a specific file i have created.

  8. #23
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Yes I gather that but your combo contents do not tell the app which Excel workbook to open, neither does it tell it where or even if the workbook already exists.

    Nor does it say what it wants to do with the workbook when it has it open? Are you wanting to post information there or something?

    I was only trying to be helpful

  9. #24
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    ok ok no problem mate.Let me explain.

    I have created a folder with many excel files in it.What i want to do is that when i selent a name from the combo box,i will press the button and it will open a specific excel file.What i do next with the file is up to me(save,close etc etc).Access wont have to do anything with the file after it is opened.When i close it i will be back to the form i was before with the combo box.Thats it.I hope i explained it a little better.

  10. #25
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Is the specific file based on which item is selected in the combo box?
    Will the file always be in the same folder.
    Will all the files be in the same source folder.

    David

  11. #26
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    Each selection of the combo box must open a different excel file.And all the excel files will be at the same folder always(the folder path will be the same).

    I want to do this in 2 forms.In the first form it only has 1 combo box and 1 button.So for each selection of the combo box when i press the button it opens an excel file.

    Now for the second form it is more complicated and i dont know if the same apply here.What i have in the second form is 4 combo boxes and a button.Following your instructions on how to link the combo boxes i have created the following combo boxes.

    Combo box 1 (Manufacturer)
    manufacturer 1
    manufacturer 2
    manufacturer 3
    manufacturer 3

    Combo box 2 (Compressor)
    Compressor 1
    Compressor 2
    Compressor 3

    Combo box 3 (Compressor parts)
    1st stage
    2nd stage
    3rd stage

    Combo box 4 (Spare parts)
    Piston rings
    Rider ring

    For each manufacturer i choose from the first combo box i can choose a compressor from the second combo box.For that compressor i choose a compressor part and then the spare part from the fourth box.What i want to do after i press the button is that for each of these selections i have created some schematics that i want to be able to see using the default windows picture and fax viewer(if that is possible).The schematics will be in simple jpeg format and will always be in the same folder all of them.Only when i have selected from all the combo boxes and i press the button will i be able to see the schematics for that part.If one of the boxes,for example the fourth box,is left without a selection i want when the button is pressed to display a message(like ''not all criteria has been selected'',or something like that).
    Last edited by viper550; 11-10-2009 at 02:19 AM.

  12. #27
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    So in escence the spare parts table will have the name of the jpeg you want to open after you have cascaded down to it.

    If you want to view the image within an Access form you will need to either, a) add an image control to the existing form or b) use a different form to vew the image.

    Which approach are you taking?

    David

  13. #28
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    Well the third and fourth combo boxes the names will be exactly as i wrote them in my previous post.Only in the first 2 combo boxes i will actually put the real names.But for all the possible combinations of all the combo boxes they will open a different jpeg file.

    For example
    Manufacturer 1 > Compressor 1 > 1st stage > Piston ring
    Manufacturer 1 > Compressor 1 > 3rd stage > Piston ring

    The 2 selection above will open a different file.Each combination of the combo boxes will open a different jpeg file.I dont want to view the image inside access.Can't we use the default windows image viewer?

    All of this is for the second form im trying to make.For the first form all i have is one combo box with some names.I choose a name,press a button and open an excel file.Thats all.

  14. #29
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Place the first segment of code in your main declarations area of the form

    Code:
     
    Option Compare Database
    Private Declare Function ShellExecute Lib "shell32.dll" _
       Alias "ShellExecuteA" _
       (ByVal hWnd As Long, ByVal lpszOp As String, _
        ByVal lpszFile As String, ByVal lpszParams As String, _
        ByVal LpszDir As String, ByVal FsShowCmd As Long) _
        As Long
    Private Declare Function GetDesktopWindow Lib "User32" () As Long
    Const SW_SHOWNORMAL = 1
    Dim sPath As String
    Once you have determined which jpeg to open and passed the name to a public variable.

    This second set of code needs to go on the click event of the button

    Code:
     
        sPath = <<YouPathToTheImagesFolder>>
        strFile = sPath & "\" & <<TheNameOfTheImageFile>>
        strFile = Replace(strFile,"\\","\")
     
        nDT = GetDesktopWindow()
        nApp = ShellExecute(nDT, "Open", strFile, "", "C:\", SW_SHOWNORMAL)
        DoEvents
    This wil open the image in its native software.

    David

  15. #30
    viper550 is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    28
    I didn't get the part on how do i link the selection i made with the file i want to open.

    As for the second segment of code you gave me i wrote this.Is this ok?Because im geting a compile error when i write it this way.

    sPath = C:\Documents and Settings\Stratos\Desktop
    strFile = sPath & "\" & DSC00109.jpeg
    strFile = Replace(strFile, "\\", "\")

    nDT = GetDesktopWindow()
    nApp = ShellExecute(nDT, "Open", strFile, "", "C:\", SW_SHOWNORMAL)

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

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