Search results

  1. M

    Troublesome textbox

    Hi Guys, Using a textbox to input information into a table, always in the same place. But I can't get it to work properly. Every time I run it, it comes up with a box that wants a value for strPath. See code below: Private Sub EnterPath_AfterUpdate() Dim strPath As String On Error Resume...
  2. M

    Need user to input file path, whats the best way?

    Thanks for your help guys, that'll be perfect. One last problem, I can't get the VBA function to recognise whats in the text box. Ive called the text box FilePath and defined it in the code as string but when I run 'msgbox filepath' the message box comes up with nothing. I'm pretty sure...
  3. M

    Need user to input file path, whats the best way?

    Hi Guys, I need something that will allow the user to enter a file path before running a function. I was thinking using a combo box or something on the main form, but I'm not sure. If this is the best way how would I link whatever is entered with a variable in the code? Cheers for your...
  4. M

    Simple Database over 500Mb in size, why?

    Hi guys, Thanks for your suggestions, I'll try them out. Ive moved all the objects over to a new database and it is only using 400k. My largest table is no more than 10k records with only 5 fields! Is there an SQL command to delete all records in a table (i've only been using access for a...
  5. M

    Simple Database over 500Mb in size, why?

    Hi, Thanks for your suggestions. The compact and repair freed up 10Mb but that still only brings it down to 545Mb. There are no embedded images in the database.
  6. M

    Simple Database over 500Mb in size, why?

    Hi Guys, The Problem: I have a database that I’ve been working on for the last few months that I have realised this morning has grown to a file size of 556Mb! It’s a database that allows a user to import txt files (of about an average of 6k records) into it and then run several vba functions...
  7. M

    Setting primary key in Vba

    hi guys, thanks for the great advice, Ive done what you suggested and created the primary key when I create the table. Seems obvious now that you've pointed it out, but i'm still quite new to this and as a result i do seem to go the long way round to solve problems pretty often! :-) Ive also...
  8. M

    db.CreateRelation problem

    Hi guys, Thanks for your help on this i had another look at the origional code you gave me, HiTech and played around with it until i got it to work. Here it is: Dim Db As DAO.Database Dim Rel As DAO.Relation Dim Fld As Field Set Db = CurrentDb() Set Rel =...
  9. M

    Setting primary key in Vba

    Hi DCrake, It needs to be automated so sadly it does need to be VBA. Is it possible to do it on table creation? This is the code I use to create my table DoCmd.RunSQL "CREATE TABLE [Data Conversion] ([Primary Key]INTEGER, [Reference Code]TEXT, [Terminal Address]TEXT, [T/R]TEXT...
  10. M

    Setting primary key in Vba

    My code imports data and creates a table to store it in. I need to set up a relation and to do this i first need to set the primary key automatically in the code. I have been playing around with two different solutions but neither work. The first: DoCmd.RunSQL = CREATE INDEX ind ON [Data...
  11. M

    db.CreateRelation problem

    Hi HiTech, Thanks for your help, its nearly working, however i'm getting the error 'No unique index found for the referenced field of the primary table' on line: db.Relations.Append rel Any ideas?
  12. M

    db.CreateRelation problem

    Am trying to create a relationship between two tables in VBA using: Dim rel As Relation Set rel = db.CreateRelation("AtoB", "[Data Conversion].Primary", "[Data Word Table].[Primary Key]") Ive tried several varients, but cannot get it to work. At the moment when i run it, it comes up with...
  13. M

    Dlookup Problem

    Thank You! Can't believe i missed that. Works fine now!
  14. M

    Dlookup Problem

    Thanks for you help, not quite there, but a step closer. The code now looks like: strSB = DLookup("Description", "SA R Lookup", "[Binary]=" & strSubAdr) & " " & DLookup("[Equipment]", "[Serial Destinations]", "[ST]=" & Word1 & "'") The error its returning now is: Syntax error in string...
  15. M

    Dlookup Problem

    Hi guys, Every time I run the code: strSB = DLookup("Description", "SA R Lookup", "[Binary]=" & strSubAdr) & " To " & DLookup("[Equipment]", "Serial Destinations", "[ST]=" & Word1) I get the error: 'You canceled the previous operation' The first Dlookup runs fine on its own, the...
  16. M

    Help with SQL UPDATE command

    Worked a treat! Thanks for the advice on using CurrentDb.Execute as well, I'll look in to it. Thanks again!
  17. M

    Help with SQL UPDATE command

    Hi Guys, I am trying to use an UPDATE command to change a record. The UPDATE result is dependant on two variables. One to indicate which record ( j ) and one to indicate the information to put in the record ( Comp ) this is what ive written: DoCmd.RunSQL "UPDATE [Command Data Table] SET...
  18. M

    Running function on field and saving results to new table

    Hi Again, Still having a little trouble with this. I'm trying to run the function on the field using DoCmd.RunSQL "UPDATE [Command Data Table] SET [Command Word]= ********;" What would go in place of the stars to address the function? The code I'm trying to run is titled...
  19. M

    Running function on field and saving results to new table

    Hi guys, I have been struggling with this one all morning and can't seem to get anywhere. I need to run a function on a whole field of data and return the results to a new field in a blank table. I have been trying to use SQL functions without any luck. I'm pretty new to VBA so nice and...
  20. M

    Newbee needs help.

    Got this to work eventually, thanks for your help, its exactly what i need
Back
Top Bottom