Some Thoughts

Jun 23, 2005

Hi All,

I am currently using some of the code from ghudson's browsing2.mdb for importing XLS files into a database that I making. After pressing the import button which triggers the importing of the file it imports the contents of the XLS into a table called import and into another table at the same time. Both the import table and the other table have the same structure. For the sake of argument lets call the other table "table B".

I want to know of a way of how during the import of the XLS it can flag with a message box to say that that the information already exists in table B, and exit out of it. I was thinking this would be done in VBA. I have written some part of it (very basic) and would appreciate someone's opinion if I am on the right track. It basically searches if the same data lies in the 2 tables and pops up a message box. I would welcome any other solutions, but I would prefer it to be VBA.

----Start of Code---------------------------------------------
Dim strCompare1, strCompare2, strAppend1 As String

strCompare1 = "Select table B.field A from table B where (select import.field A from import);"

strCompare1 = "select import.field A from import where (select table B.field A from table B);"

CurrentDb.Execute strCompare1
CurrentDb.Execute strCompare2

If strCompare1 <> strCompare2 Then
strAppend1 = "INSERT INTO table B ( field A, field B, field C) SELECT
Import.field A, Import.field B, Import.field C FROM Import;"
CurrentDb.Execute strAppend1
Else
MsgBox "Piece-Marks already exist in the database, so if it is an update
then use the update function"
End If

--------End of Code--------------------------------------------------

Cheers
Greg

View Replies


ADVERTISEMENT

Thoughts On VB.Net Front End

Nov 21, 2007

I have a wonderful database I designed almost 2 years ago. Other than a few hiccups with corrupted data (http://www.access-programmers.co.uk/forums/showthread.php?t=135483), my employer is 100% satisfied with it.

I’m graduating this winter with an AS in computer programming and I would like to update the database to a VB/ADO .NET (VS 2003) front end before I leave. Being a VB developer, I have had my fair share of “quick fixes” when I could not work out a solution with VBA. VBA is the evil twin of VB lol.

Other than PHP w/ MySQL I have never used two separate entities for data management. It’s always been strictly MS Access as the database and front end.

So my question is what major differences should I expect that I took for granted with MS Access’s built in functionality? Such as subforms with master/child properties, navigation, printing reports etc. Will I have to write code for every little detail that MS Access handled for me?

What are your thoughts on using VB.NET as a front end? Did the pros out weigh any cons from your experience with this setup? Any thoughts on using Crystal Reports?

View 3 Replies View Related

Help With Thoughts/idea's On Doing This

Oct 14, 2004

Looking for some advise and help. I think an array will be recommended and if so, please help with code on how to do this.

I am trying to track prescription (Rx) dates (RxOutDate) going out to medical professionals on a particular order. There can be mulitple Rx going out so there will be multiple dates of when those Rx went out. What I would like to do is have the earlies date posted. ie one Rx went out on 10/13/04 and another goes out on 10/14/04. I would like for the 10/13/04 date to show. I'm using a continuous form to display all Rx's per order, on frmRx. I'm trying to display the date out on the form containing the order (frmOrder).

Any thoughts would be greatly appreciated. If an array is suggested. Please help with code on how to it. I've never written one so I would definitely be in the dark.

Thanks ahead of time,
Shane

View 1 Replies View Related

DateDiff Issue.. Any Thoughts

Feb 27, 2007

I am trying to calculate the number of weekdays between two dates in an access query.

I'm using Expr 1: DateDiff("w", #4/01/2006#, #02/26/2007#)

When I use this expression with "d" instead of "w" I get 331 days, but when I use "w" I get 47 days. I know this can't be right.... Is there something I'm missing here?

I looked up on msdn and "w" is for weekday. Is there something that I need to do to be more specific?

Any help is appreciated.


Thanks

View 4 Replies View Related

My Questionaire Table Design-normalization! Your Thoughts Please?

Jun 16, 2006

Im planning a db client's dinner questionaire that will comprise of client's favorites (meals, games, transportation). Each client is allowed to bring a guest. So the client's will also be filling out "the same set" of questionaire for his/her guest.

Meaning, a user will need to fill out the same form twice, one for himself and one for his guest.

Now, my question is, should i have two tables. Client's questionaire table and Guest questionaire tables with foreign key in the guest's table showing who's guest the question belongs to?

Or should i have one table for everyone (since they are the same set of questions). Having one table seem like a wise idea since it's the same set of questions (don't want to have 2 duplicate tables with only one field different). Now, if i go with one table. How do i go about handling this? So that client's and guest's info are linked. and i can run a query to tell who's guest it is? I have never tried thsi before. Care to share your thoughts?

View 3 Replies View Related

Storing Multiple Ranges Per Record...thoughts?

Jun 21, 2007

Hi, I'm very new to this so your patience and help is requested.

I need to store multiple ranges per record in my relational db, i.e.

A: 3500-4800, 5230 (spot) , 6400-7900

Etc, I need the data to be searchable with minimal fuss and coding.

Any help would be very very welcome.

Cheers

View 5 Replies View Related

Weird Table "corruption" Occurring. Thoughts?

Mar 10, 2008

I put a split database (created in 2000 format using Access 2003 SP2) on the network three weeks ago. Three times the entries in two of the columns have been changed for every record, essentially making the data useless. I have not been able to narrow it down to a specific event that is causing it in order to program around it. Any thoughts would be greatly appreciated. Here are the details:

The table involved is called tblTitleLog. It contains 13 columns, the first of which is an autonumbered ID field. Column 7 is called CompletedCSA. Column 9 is called CompletedDate. The data in those cells could be different, from record to record, or could be the same as several records on either side of it. The data in those two cells can be updated either of two ways:


On a per-record basis using a form that contains controls tied directly to the cells for a given record, or
On a form that incorporates a multiselect listbox and an Update button. This form is specifically designed to allow batch updating of those two columns.


On three separate occasions, the data in those two cells suddenly changed for all 6940+ records. For example:

This:
CompletedCSA CompletedDate
Timmy 2/2/2008
Bobby 2/5/2008
Joey 2/10/2008

Would suddenly change to:
CompletedCSA CompletedDate
Bobby 2/5/2008
Bobby 2/5/2008
Bobby 2/5/2008

No warning messages about multiple people trying to change the same record(s) is displayed. None of the users have been able to spot a trend in something they were doing when it occurred. The code for the Update button on the batch update form only changes the records with the ID of the SelectedItems.

This is the code from the Update click event on the BatchUpdate form:

For Each i In Me.listboxTitles.ItemsSelected
strWhere = strWhere & Me.listboxTitles.ItemData(i) & ", "
Next

If Len(strWhere) > 0 Then
strWhere = "WHERE ID IN (" & Left$(strWhere, Len(strWhere) - 2) & ")"
End If

strSQL = "UPDATE tblTitleLog " & _
"SET tblTitleLog.CompletedCSA = '" & Me.cboCompletedCSA.Value & "', tblTitleLog.CompletedDate = '" & Me.txtCompletedDate.Value & "' " & strWhere

CurrentDb.Execute strSQL, dbFailOnError

The controls on this form are all unbound.

Duplicating the same actions the users reported just before it happened didn't seem to make a difference. So far, I haven't been able to duplicate the conditions. Management is not happy and I'm frustrated. Any thoughts or suggestions on how to prevent this from happening again?

Thanks,

DiverGuy

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved