Results 1 to 5 of 5
  1. #1
    rsf is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    2

    Inserting through views. Automatically insert criteria value

    Hello


    I have a table containing dimensional data for several products.
    The dimensions are stored in generic fields called d1, d2, d3, d4 etc, etc
    There is an dimtype field that identifies the dimensional schema and what fields are used.
    I wan't to create views for each dimensional schema and add meaningfulness names to each field.
    This way I can insert records through that view witch is a great access feature.
    The annoyance is that I need to insert the "dimtype" field value that is always the same for each view. It is the only field used as criteria (in the WHERE clause) and it shouldn't even be visible

    Is there a way to automatically insert this field witgh the value usede in the criteria?

    Thanks in advance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Not understanding your data structure well enough to advise. Please clarify.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I don't understand your use of jargon either. Can you give us an example of what you're trying to accomplish.

  4. #4
    rsf is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    2
    Hi..
    I have a table with the following fields (simplified):
    PartID
    DimType
    D1
    D2
    D3
    ...
    D16

    In this table I store dimensional data products identified by PartID
    Not all parts (products) have the same dimensional structure because they have different shapes.
    The "D" fields store each dimension.
    Instead of creating one table for each part type dimensional data I have only one this table and a dimtype field that identifies the shape of the part and of course the dimensional structure (measurements necessary to dimension that specific part shape).

    When inserting data I don't want to remember what "D" fields are used for that particular part so I created a view for each different part shape (dimtype) and name the fields with more descriptive names as well as the table itself.

    Each view is filtered to a specific dimtype (of course...) and I insert records directly from the view but I need to insert the dimtype also.
    I wanted to know if access could automatically insert it since the view is filtered by that field.
    Having (WHERE dimtype = 1) I would expect access to automatically insert 1 in the that field and it would not even be visible in the view.

    Not that this is some big problem...It's just something that a more proficient user would know and I can't figure out.

    Thanks

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    By 'view' I am guessing you mean a form. Could have code behind each form that will set the value of the DimType field when move to record. The form OnCurrent event would serve. Code like:

    If IsNull(Me!DimType) Then Me!DimType = whatever value is appropriate for this form

    How many dimension types and forms are there?

    Could have only one form and then with VBA code control what is displayed in each label caption. Again, code in the OnCurrent event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-03-2011, 01:02 AM
  2. Replies: 0
    Last Post: 05-26-2010, 05:46 PM
  3. Replies: 7
    Last Post: 03-03-2010, 11:06 AM
  4. Replies: 4
    Last Post: 01-19-2010, 05:36 AM
  5. Alter Views/Queries in MDB from C# application.
    By avadhutkhavare in forum Access
    Replies: 0
    Last Post: 11-03-2009, 04:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums