Full Version: TransferSpreadsheet data display
UtterAccess Forums > Microsoft® Access > Access Forms
ebwhittaker
Got the TransferSpreadsheet working but would like to know if there is a way to have the
form go to and display the record that was imported? Right now it will import but the form display stays on the exisiting record.
Thanks
ed
kbrewster
Well the imported record may be hard to identify. You could try finding the Max primary key in the table which may be the last record entered. BUT of course if this is a multi-user database, someone may commit a record to the table right after you import and then this would show the wrong record.
How are you importing the record? Are you importing it into a temp table first?
ebwhittaker
I am importing directly into the table and was thinking maybe I could do something like a dlookup using the phonenumber as the criteria since it would be unique to that person but not sure if or how this would work
Is there a particular reason to import to a temp table first? I would be dealing with one record at a time, although it is conceivable that this might escalate into more than one record at a time in the future
thanks
ed
kbrewster
Where does the phone number come from? How will you know which phone number to do a Dlookup on?
So, there is no reason to import to a temp table first. Some people do it this way and I was just wondering how you were doing it.
ebwhittaker
Ok, the 'Excel' spreadsheet information will come from an online forms provider that allows me to compile all the form entries into an Excel spreadsheet and download it. The form will have many fields but right now I am just using LastName, FirstName and Phone. I have tried it with several completed forms and imported into the access database with no problem. Obviously using this method the Phone field would not work since there would be more than one entry. I kinda shot myself in the foot on that one, however, I still need a way, if possible to bring up the newest entry(s) imported into the database. Hmm, what about a Query that would look for the date added?
What I need to do is make it easier for the user to bring up each person that completed the form, which could be one or many. Each would have a seperate record in the customer database, so maybe a Query?
Thanks
ed
kbrewster
Well, like I said before, you could try a DMax on the primary key field...
im lngPK as Long
lngPK = DMax("PrimaryKeyField", "NameOfTable")
So the above will give you the high primary key number and then from there you could go to that record. But again, if this is a multi-user database the DMax may not always return the correct number if two people are adding records...
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.