Browing2 Example

gtcoglan

Registered User.
Local time
Today, 09:41
Joined
Jun 9, 2005
Messages
13
Hello,

I was looking at the browsing2 example that ghudson developed and I would like to use it for my application. So for those who are familiar with it you maybe able to answer my question. When I tried to use the import function with a spreadsheet of a particular field format it came up with the following error:

2391-Field F1 doesn't exist in destination table timport.

Now I changed the tImport table field headings to match my spreadsheet but I was still coming up with this error. Also I manually imported the spreadsheet to see the fields of the table created from the manual import. This helped me check that the fields of tImport matched the spreadsheet.

So if anyone could tell me what I need to do to so that a spreadsheet of a particular heading format could be imported into the browsing2 example.

Thanks for everyones help
Greg

PS My knowledge on VB is limted so be kind to me
 
Last edited:
Welcome to the forum!

Excellent example of a first post. ;)

Do any of your Excel headers have any special characters (_*&^%$#@!) or spaces " " for Access does not like that kinda stuff.

Try importing the file without the headers. You will have to alter your code with the FALSE option for no headers and remove them from your spreadsheet. If you must have headers then you should rename them to something short and simple.

Here is the link to the Browsing2 sample he is referring to... Browse [Find a directory or file]
 
I tried shortening the header fields and not having the header fields containing special characters or spaces, but still no luck.Where do you put the false headers option into...Can you give an example of the code.

Also is there anything that I must do with the timport table, i.e change the column names to match the spreadsheet header names that I am importing?
Thanks for your help

Greg
 
Last edited:
gtcoglan said:
I tried shortening the header fields and not having the header fields containing special characters or spaces, but still no luck.Where do you put the false headers option into...Can you give an example of the code.

Also is there anything that I must do with the timport table, i.e change the column names to match the spreadsheet header names that I am importing?
Thanks for your help

Greg
Your table field names must match the Excel files column headers.

Here is an example of the False option when your Excel files does not contain column headers. Check out the Access help file for more information on using the TransferSpreadsheet method with all the options and examples.

Code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "YourTableName", "C:\Test.xls", False
 
Hi,

I tried matching the columns of the table with the columns of the spreadsheet and I am still getting the error. I have uploaded the mdb up with a copy of the spreadsheet (i.e. zipped) that I would like to import. Also you can see how I have structured the tImport table to match the spreadsheet columns. Can someone please help me to see where I am going wrong.

Thanks so much for everyone's help
Greg
 

Attachments

I have not clue as to what and or how you are trying to import the file for I do not see where you have modified the code to import your file. The sample I posted will only work as-is for testing purposes for it will not actually import your selected file for the sample would not know how your data is structured.

I modified the bImport_Click() event in the fFindOpenImportFile form with the below code and it works to import your spreadsheet.

Code:
Private Sub bImport_Click()
On Error GoTo Err_bImport_Click

    Me.tbHidden.SetFocus
    
    If IsNull(tbFile) Or tbFile = "" Then
        MsgBox "Please browse and select a valid file to import.", vbCritical, "Invalid File"
    Else
        If Dir(tbFile) <> "" Then
            CurrentDb().Execute "DELETE * FROM tImport"
            DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tImport", "C:\Documents and Settings\hudsong\Desktop\browsing2greg\Importold.xls", True, ""
            MsgBox "Import completed.", vbInformation
        Else
            MsgBox "The ''" & tbFile & "'' file can not be found.", vbInformation, "Import Aborted"
        End If
    End If
    
Exit_bImport_Click:
    Exit Sub

Err_bImport_Click:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_bImport_Click

End Sub
 
More Browsing2 questions

Hi!

I downloaded Browsing2 and converted it to Access 2002. It works fine when I run it as a stand alone DB. However, when I import it to my DB, it gives me a 13-type Mismatch error. This is without modifying the table, form or anything else...all I did was import it. Any idea what is going on? I did make sure DAO 3.6 was checked, but that did not seem to fix it. Any help would be greatly appreciated

Thanks in advance,

Shrink
 
You will have to post your db so that we can look at it. No way to guess what is wrong without seeing it. I might not be able to check it out today. State exactly what you are trying to do and what is not working as expected. The more details you include the better your chances of somebody taking the time to help you.
 
Thanks for the response. Please find the attached db. I could not attach my complete db because it will be used in healthcare and contained confidential medical info. However, the attached db is a copy of my db with all the tables, forms, etc removed. I still get the same problem, so it shouldnt matter.

As far as what I was trying to do, I was simply importing your existing db to my db. I then ran it to make sure everything was ok and the problem arose. I didnt modify any of your code. As far as what I want to do, I want to use it to look at our directories of scanned documents so the user can see any document associated with a particular chart number.

If you need anything else, please let me know. This db seems to be exactly what I'm looking for, with very little modification.

Thanks in advance,

Shrink
 

Attachments

same problem - any insight into this most helpfull
Problem i have is the folder changes per recordset ,
so >>'
many thanks
gbp
 
I can see the error in your db but I do not know what the problem is. I converted my old browsing sample into an Access 2000 version. See if this works for you.
 

Attachments

Thanks for the file, but I still have the same problem. I'm glad to see someone else has the same thing happen... I thought it was just me. If you get it figured out, please post the fix. I'll continue to monitor this thread and see if I can work a fix as well. If I get it figured out, I'll let you know.

Thanks for all your help so far!

Shrink
 
Still got this problem myself - i have asked a friend of mine to have a look (but he's up to his eyes at the mo)- I try a little chaser on this next week

I've had some thoughts on this my self - but i'll try them out and see what happens before I share them otherwise I'll just confuse the issue- (and they are probably a long shot any way
grr
 
just a quickie just notice that ghudson is USA not sure where Shrink is from but if fromthe UK could it be the date formatting of the tables ????????
USA style is mm/dd/yyyy UK style is dd/mm/yyyy - - ???? if Shrink is from the US then this doesn't hold any weight
grr
 
found this out myself - tried it in the UK and it just converted to USA style, i had it semi working for about a minute and then it fell over , tried it again and got back to the same old problem, I am running this pass my guru friend and as soon as he supplies the answer, i forward it .

Gary
 
I didn't figure out the problem, but I did find a "work around". Instead of importing from browsing2 to your database, import all your database tables, forms, etc., into browsing2. I did this and it works! I'd still like to figure out what the problem is, but for now this works for me.
 

Users who are viewing this thread

Back
Top Bottom