User Profile

Collapse

Profile Sidebar

Collapse
rewalk
rewalk
Last Activity: Aug 10 '07, 01:31 PM
Joined: Jun 21 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • In VBA it's DoCmd.SetWarnin gs False.
    See more | Go to post

    Leave a comment:


  • rewalk
    replied to Help with a GUi
    I may be wrong, but I believe that in order for your code to work you need to add a reference to the Microsoft Scripting Runtime. To do this go to your VBA editor and then Tools, References, scroll down until you see this choice and click the box next to it. I know that in order to access File System Objects you need this reference added and I suspect that maybe this reference isn't added in. If it is I apologize, but I figured I'd throw this out...
    See more | Go to post

    Leave a comment:


  • rewalk
    replied to SQL Code to Set Desired Relationship
    No need to apologize. Thank you for that bit of information I'll be sure to keep that in mind as I continue to work with Access.
    See more | Go to post

    Leave a comment:


  • rewalk
    started a topic Returning a Value from a Select Query

    Returning a Value from a Select Query

    I'm using Access 03 on Windows XP Pro.

    I have a section of code that is creating an excel spreadsheet. In the first column I need to put a unique value corresponding to a given location that is given by an autonumber in one of the tables. I know that you can't use DoCmd.RunSQL to run a Select query, as it isn't considered an action query. Is there another way to go about finding this value from the table and storing it so that it...
    See more | Go to post

  • rewalk
    replied to SQL Code to Set Desired Relationship
    Please excuse my ignorance, but why would long vs. integer make a difference because when the field is added to the table they both get put in as a number. I'm just curious for future reference.
    See more | Go to post

    Leave a comment:


  • rewalk
    replied to SQL Code to Set Desired Relationship
    I tried that and it didn't work. Same syntax error. I tried multiple other variations and the same error continuously popped up so I decided to radically change how I was approaching it and I came up with a solution. I switched to ADO and the same syntax worked fine. To follow is the code I used.

    Code:
    Private Sub Create_Table_Click()
    
    Dim SQL As String
    Dim tblName As String
    Dim cmd As New ADODB.Command
    ...
    See more | Go to post

    Leave a comment:


  • rewalk
    replied to SQL Code to Set Desired Relationship
    UPDATE: I also tried the following thing as well, but it also didn't work:

    Code:
    SQL = "ALTER TABLE [Test Table] add CONSTRAINT fk_ID Foreign Key(ID) References [Key Metrics](ID) ON DELETE CASCADE;"
    The error it gives me is the following:
    Run-time error '3289': Syntax error in CONSTRAINT clause.

    I tried just putting it into the query editor instead of VBA and it gives the same error and then...
    See more | Go to post

    Leave a comment:


  • rewalk
    started a topic SQL Code to Set Desired Relationship

    SQL Code to Set Desired Relationship

    Hello all! First thank you to everyone in this community that has been helping me over the past few days. It's greatly appreciated and I've learned a lot. At the moment I'm trying to write some SQL code to set up the proper relationship between a created table and an existing table. The existing table is called key metrics and it has an autonumber primary key ID. The created table has a field also called ID, which is a number...NOT an autonumber,...
    See more | Go to post

  • rewalk
    replied to Generating SQL on the Fly
    Excellent. That did the trick and I got everything to work. Thank you very much!
    See more | Go to post

    Leave a comment:


  • rewalk
    replied to Generating SQL on the Fly
    Thank you so much. I'm very grateful for your help!
    See more | Go to post

    Leave a comment:


  • rewalk
    replied to Generating SQL on the Fly
    Yes! That sounds like exactly what I'm looking for. Would it then be possible to have this set of precedures generate some SQL code that would have its results opened in Excel?
    See more | Go to post

    Leave a comment:


  • rewalk
    started a topic Generating SQL on the Fly

    Generating SQL on the Fly

    Hello all,

    First, I'd like to thank everyone that helped me with my last problem. It was greatly appreciated. What I'm trying to do is generate SQL on the fly so that a report can be generated and exported to Excel based on selections made by the user. For example, they'll select a date range, a location and what they want to sort the data by. Can anyone point me in the right direction as to how to do this? Thank you in advance for...
    See more | Go to post

  • Hey Brad,

    I just wanted to let you know I ended up figuring it out and wanted to thank you for your help and guidance. The way I did it was using a DoCmd to import the spreadsheet directly to a query which split the information up. Thank you again for all your help.
    See more | Go to post

    Leave a comment:


  • rewalk
    replied to Primary Key Issues
    Here is the code that I've made so far which succesfully imports the files. Special thanks to members ont his network that have helped me fix some quirks in this code in the last discussion I made:

    Code:
    Private Sub Done_Click()
    
    Dim File As String
    Dim LastDataColumn As String, LastDataRow As String
    Dim LastDataCell As String
    
    'Set File name
    File = "C:\Sample Data.xls"
    ...
    See more | Go to post

    Leave a comment:


  • rewalk
    started a topic Primary Key Issues

    Primary Key Issues

    Hello all,

    I previously posted under this heading: Importing Data from One Excel Sheet into Multiple Access Tables Simultaneously, but the nature of the problem has changed so I decided to make a new discussion. Thanks to one of the members here I was able to successfully import the data into the tables from the excel spreadsheet and I greatly appreciate his help. However, I've run into a new problem. The first table assigns the unique...
    See more | Go to post

  • Brad,

    Thanks for that bit of code. That definitely helped. However, it led me to another problem. The ID is set by an autonumber in the first table things are copied into. However, this ID needs to be duplicated in all the other tables. The reason for this is because users run reports that pull information together from the various tables in stages, so access needs to know what entries go with what entries in each table. I can't find...
    See more | Go to post

    Leave a comment:


  • Importing Data from One Excel Sheet into Multiple Access Tables Simultaneously

    Hello all,

    I've set up protected Excel sheets that users can paste data into. I then need to be able to pull the data they paste into multiple access tables and then reset the Excel spreadsheet back to the template. For example, the first few columns go to the first table, the next 3 into a second table and so on. Is this possible? I can't think of a way to do it. Thanks in advance for all your help!
    See more | Go to post
No activity results to display
Show More
Working...