Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    20

    Unanswered: Changing Field Name with Macro

    Is there a way using a Macro to open a table, pick out a specific field, and then rename that field something else.

    The field name would initially be one of three names (like Cat, dog, canary), but it would always be re-named the same name (like Horse).

    I need to run queries, but because the name can be one of 3 types, I don't want to have to run 3 sets of the same query just because of that one field.

    Any help is greatly appreciated,

    Thanks
    Dante

  2. #2
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    explain more and i'll give you a snippet of code that will achieve what you are after...

  3. #3
    Join Date
    Nov 2003
    Location
    San Francisco, CA USA
    Posts
    59

    Doesn't make sense

    It sounds like you're trying to do something the hard way that could be done much more simply.

    I agree with Rockey. We need more info.

    I'm guessing at what you want but if it sounds like maybe doing a single UNION query with three parts that each pull the different field might give you what you want.

    That doesn't alter your table design but does pull data from three different fields into one result field (that you can call anything you want regardless of the actual field names). BTW, It's not an option on the menu, you have to write it in SQL. I can help if this is on the right track.

    Even if that's not exactly what you want, I'm pretty confident that you can get what you need without altering your table design. That's just an accident waiting to happen.

    Tell us more...

    Magee

  4. #4
    Join Date
    Aug 2003
    Posts
    20

    Re: Doesn't make sense

    [QUOTE][SIZE=1]Originally posted by mageem
    It sounds like you're trying to do something the hard way that could be done much more simply.

    I agree with Rockey. We need more info.

    I'm guessing at what you want but if it sounds like maybe doing a single UNION query with three parts that each pull the different field might give you what you want.

    That doesn't alter your table design but does pull data from three different fields into one result field (that you can call anything you want regardless of the actual field names). BTW, It's not an option on the menu, you have to write it in SQL. I can help if this is on the right track.

    Even if that's not exactly what you want, I'm pretty confident that you can get what you need without altering your table design. That's just an accident waiting to happen.

    Tell us more...

    -------
    Hey Mageem and Rocky,

    Sorry for the late response, yesterday was busy.

    More details, well it's like this.

    I have a series of queries that the Table in question runs through. Okay, as I'm thinking through this, I guess the trouble isn't with the table, it's with the table that it's linked to. Sometimes that table has a different name (ZIP, ATZ, PCR), but actually what's important is that depending on what label it has (which designates the level of geography), it needs to get hooked up to a different Master Table (the ZIP, ATZ, or PCR level table, where important info is added in the query).

    SO, I have about 5 queries that the Table goes through to spit out various reports etc, but what I want is not to make 15 queries, 5 with the Master Table "A", 5 with the Master Table "B", 5 with the Master Table "C".

    I think I'm getting muddled in my thoughts. Let me know if I've made it worse. If so, I apologize ahead of time. It think for right now, I won't need it at these 3 levels, but in the coming months I will...so I'm just trying to think ahead.

    Sorry for the long response, and thanks in advance for any words of wisdom,
    Dante33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •