If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Will not open Dialog box
This should call the "Open Dialog Box". it errors out on strFilter=
ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
#2
|
|||
|
|||
Will not open Dialog box
Did you copy all of the code from
http://www.mvps.org/access/api/api0001.htm? I can attest for the fact that it works fine in Access 2003 (and Access 97) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... This should call the "Open Dialog Box". it errors out on strFilter= ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
#3
|
|||
|
|||
Will not open Dialog box
no just whats here. I did not see the "Excel" in that part of the code. Can I
just list the Excel call? "Douglas J. Steele" wrote: Did you copy all of the code from http://www.mvps.org/access/api/api0001.htm? I can attest for the fact that it works fine in Access 2003 (and Access 97) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... This should call the "Open Dialog Box". it errors out on strFilter= ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
#4
|
|||
|
|||
Will not open Dialog box
Copy all of the code in the shaded box (between Code Start and Code End)
into a new module, and save it with a unique name (say, mdlCommonDialog). Then your code will work. Unless you copy that code, it will not work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message news no just whats here. I did not see the "Excel" in that part of the code. Can I just list the Excel call? "Douglas J. Steele" wrote: Did you copy all of the code from http://www.mvps.org/access/api/api0001.htm? I can attest for the fact that it works fine in Access 2003 (and Access 97) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... This should call the "Open Dialog Box". it errors out on strFilter= ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
#5
|
|||
|
|||
Will not open Dialog box
Doug,
I have not used this API before, I just set the path name. With this Db, I have a Form, and I want the users to be able to click and have the Open Dialog Box to prompt them for file location. I copied the complete code, but I get an error right after this next lines stating “only comments can appear”…… These will be Excel files only. I just don’t know what I am doing wrong. Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _ Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _ Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long "Douglas J. Steele" wrote: Copy all of the code in the shaded box (between Code Start and Code End) into a new module, and save it with a unique name (say, mdlCommonDialog). Then your code will work. Unless you copy that code, it will not work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message news no just whats here. I did not see the "Excel" in that part of the code. Can I just list the Excel call? "Douglas J. Steele" wrote: Did you copy all of the code from http://www.mvps.org/access/api/api0001.htm? I can attest for the fact that it works fine in Access 2003 (and Access 97) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... This should call the "Open Dialog Box". it errors out on strFilter= ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
#6
|
|||
|
|||
Will not open Dialog box
Doug,
I have not used this API before, I just set the path name. With this Db, I have a Form, and I want the users to be able to click and have the Open Dialog Box to prompt them for file location. I copied the complete code, but I get an error right after this next lines stating “only comments can appear”…… These will be Excel files only. I just don’t know what I am doing wrong. Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _ Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _ Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long "Douglas J. Steele" wrote: Copy all of the code in the shaded box (between Code Start and Code End) into a new module, and save it with a unique name (say, mdlCommonDialog). Then your code will work. Unless you copy that code, it will not work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message news no just whats here. I did not see the "Excel" in that part of the code. Can I just list the Excel call? "Douglas J. Steele" wrote: Did you copy all of the code from http://www.mvps.org/access/api/api0001.htm? I can attest for the fact that it works fine in Access 2003 (and Access 97) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... This should call the "Open Dialog Box". it errors out on strFilter= ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
#7
|
|||
|
|||
Will not open Dialog box
It sounds as though you might have copied too much (only copy what's in the
shaded area), or else you didn't copy it into a new module. Make sure it's an actual module, as opposed to a Class Module. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... Doug, I have not used this API before, I just set the path name. With this Db, I have a Form, and I want the users to be able to click and have the Open Dialog Box to prompt them for file location. I copied the complete code, but I get an error right after this next lines stating "only comments can appear".. These will be Excel files only. I just don't know what I am doing wrong. Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _ Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _ Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long "Douglas J. Steele" wrote: Copy all of the code in the shaded box (between Code Start and Code End) into a new module, and save it with a unique name (say, mdlCommonDialog). Then your code will work. Unless you copy that code, it will not work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message news no just whats here. I did not see the "Excel" in that part of the code. Can I just list the Excel call? "Douglas J. Steele" wrote: Did you copy all of the code from http://www.mvps.org/access/api/api0001.htm? I can attest for the fact that it works fine in Access 2003 (and Access 97) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... This should call the "Open Dialog Box". it errors out on strFilter= ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
#8
|
|||
|
|||
Will not open Dialog box
Doug, I have been using the Get External Data (Excel spreadsheet) then converting it to a table, then run the Find Duplicates Query. The code you told me to copy does work, but does not bring up the file for me to convert to a table. I am like DOEY! "Douglas J. Steele" wrote: It sounds as though you might have copied too much (only copy what's in the shaded area), or else you didn't copy it into a new module. Make sure it's an actual module, as opposed to a Class Module. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... Doug, I have not used this API before, I just set the path name. With this Db, I have a Form, and I want the users to be able to click and have the Open Dialog Box to prompt them for file location. I copied the complete code, but I get an error right after this next lines stating "only comments can appear".. These will be Excel files only. I just don't know what I am doing wrong. Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _ Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _ Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long "Douglas J. Steele" wrote: Copy all of the code in the shaded box (between Code Start and Code End) into a new module, and save it with a unique name (say, mdlCommonDialog). Then your code will work. Unless you copy that code, it will not work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message news no just whats here. I did not see the "Excel" in that part of the code. Can I just list the Excel call? "Douglas J. Steele" wrote: Did you copy all of the code from http://www.mvps.org/access/api/api0001.htm? I can attest for the fact that it works fine in Access 2003 (and Access 97) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... This should call the "Open Dialog Box". it errors out on strFilter= ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
#9
|
|||
|
|||
Will not open Dialog box
I have no idea what you mean by "bring up the file for me to convert to a
table". All that code does is return the full path to the file. You have to take that full path and do something with it. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "tmaxwell" wrote in message ... Doug, I have been using the Get External Data (Excel spreadsheet) then converting it to a table, then run the Find Duplicates Query. The code you told me to copy does work, but does not bring up the file for me to convert to a table. I am like DOEY! "Douglas J. Steele" wrote: It sounds as though you might have copied too much (only copy what's in the shaded area), or else you didn't copy it into a new module. Make sure it's an actual module, as opposed to a Class Module. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... Doug, I have not used this API before, I just set the path name. With this Db, I have a Form, and I want the users to be able to click and have the Open Dialog Box to prompt them for file location. I copied the complete code, but I get an error right after this next lines stating "only comments can appear".. These will be Excel files only. I just don't know what I am doing wrong. Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _ Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _ Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long "Douglas J. Steele" wrote: Copy all of the code in the shaded box (between Code Start and Code End) into a new module, and save it with a unique name (say, mdlCommonDialog). Then your code will work. Unless you copy that code, it will not work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message news no just whats here. I did not see the "Excel" in that part of the code. Can I just list the Excel call? "Douglas J. Steele" wrote: Did you copy all of the code from http://www.mvps.org/access/api/api0001.htm? I can attest for the fact that it works fine in Access 2003 (and Access 97) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... This should call the "Open Dialog Box". it errors out on strFilter= ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
#10
|
|||
|
|||
Will not open Dialog box
Doug,
Once I got it to return the full path, it allows me to pick the file, once I do, nothing happens. I just not sure I am going about this the right way. As I stated, I was using the create new table, and on the file menu I was using the "Get External Data" choosing the Excell file, then converting the Excel file to a table. Then I ran the New query "Find duplicate records" Qry. I need to put this on a from page for the users to be able to do on there own. "Douglas J. Steele" wrote: I have no idea what you mean by "bring up the file for me to convert to a table". All that code does is return the full path to the file. You have to take that full path and do something with it. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "tmaxwell" wrote in message ... Doug, I have been using the Get External Data (Excel spreadsheet) then converting it to a table, then run the Find Duplicates Query. The code you told me to copy does work, but does not bring up the file for me to convert to a table. I am like DOEY! "Douglas J. Steele" wrote: It sounds as though you might have copied too much (only copy what's in the shaded area), or else you didn't copy it into a new module. Make sure it's an actual module, as opposed to a Class Module. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... Doug, I have not used this API before, I just set the path name. With this Db, I have a Form, and I want the users to be able to click and have the Open Dialog Box to prompt them for file location. I copied the complete code, but I get an error right after this next lines stating "only comments can appear".. These will be Excel files only. I just don't know what I am doing wrong. Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _ Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _ Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As Boolean Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long "Douglas J. Steele" wrote: Copy all of the code in the shaded box (between Code Start and Code End) into a new module, and save it with a unique name (say, mdlCommonDialog). Then your code will work. Unless you copy that code, it will not work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message news no just whats here. I did not see the "Excel" in that part of the code. Can I just list the Excel call? "Douglas J. Steele" wrote: Did you copy all of the code from http://www.mvps.org/access/api/api0001.htm? I can attest for the fact that it works fine in Access 2003 (and Access 97) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tmaxwell" wrote in message ... This should call the "Open Dialog Box". it errors out on strFilter= ahtAddFilterItem I am using 2003 access. I am use to working with access 97? Private Sub Command39_Click() On Error GoTo Err_Command39_Click Dim strFilter As String Dim strInputFileName As String strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS") strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, OpenFile:=True, _ DialogTitle:="Please select an input file...", _ Flags:=ahtOFN_HIDEREADONLY) Exit_Command39_Click: Exit Sub Err_Command39_Click: MsgBox Err.Description Resume Exit_Command39_Click End Sub |
Thread Tools | |
Display Modes | |
|
|