Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1

    Answered: MS Access FAQ (Read Me First - NO SERIOUSLY)

    YAY, A FAQ!

    Hey, this FAQ is outright anemic, what gives?
    I know, I know. This FAQ is just getting off the ground and doesn't have much useful content yet. If you have a suggestion for a FAQ to be written or [Hallelujah]are willing to write one yourself[/Hallelujah], please, PLEASE PM me and I'll post the topic here/post your faq.

    Also, I'm still open to ideas about the format of the individual FAQ's. If you have an opinion on the matter, let it be heard here. We don't bite... hard... unless you ask... then it costs money.

    Also Also, If you happen to peruse the thread while it's not locked, please do not post. I am trying to restrict this thread to only FAQ's, discussion about the FAQ's would be better placed elsewhere... like here, for instance

    General Topics


    Requested FAQ Topics:
    • Cascading ComboBoxes
    • *** Your suggestion here ***
    Last edited by Teddy; 04-17-06 at 13:24.

  2. Best Answer
    Posted by Teddy

    "How Do I Ask A Question?

    You may notice that some folks get their questions answered almost immediately while others will languish for days before receiving their first reply. Contrary to popular belief, this rarely has anything to do with us playing favorites (sometimes it does, but that's only if the poster is exceptionally awesome). In general, the reason one question gets a plethora of support while another gets squat is because of how the question was asked.


    Some of our members are quite skilled in a variety of disciplines, some are outright experts, none are cairvoyant. When posting your question, please include:
    • POST YOUR ACTUAL QUESTION IN THE THREAD TITLE. The fact that you are posting here in the first place is a good indicator that you "NEED HELP PLZ!11!". You are more likely to receive timely assistance if there is something meaningful in your thread title that will allow someone scanning the forums to identify your post as an area of their expertise.
    • What version of Access you're using
    • The business logic or problem you are trying to solve with your application
    • The SPECIFIC behavior or lack thereof that describes your problem
    • If you're posting regarding an error, please, post the error. C'mon, seriously folks.
    • Post your current solution, what it's doing that you don't like AND an example of your desired results
      For general SQL/table design/query issues, this would include a full description of the tables involved; Sample data; and sample result records.


    Also, we do not know anything about your project or application unless you explicitly tell us about it. That means a question such as, "The client button doesn't populate the third insurance claim selector with the code!!!" will go unanswered. We don't know what you're talking about, sorry.

    In short, give us half a chance at actually being able to answer your question. Make it as easy as possible, and you're FAR more likely to get a response.

    When you have arrived at a solution to your problem, please report back to the thread to let us know what did the trick. I know it cuts into your time a bit and isn't necessary once you solved your issue, but gee golly it gives us the warm fuzzies and helps out the next poor schmoe who comes along with the same question. As a bonus, we'll take a shine to ya'"


  3. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What's a FAQ?

    FAQ:Frequently Asked Questions.

    A FAQ is a list of common questions with their answers, maintained by most special interest groups on the Internet as a way of lowering the frequency of basic technical questions.

    The MS Access FAQ contains the most commonly asked questions (and their solutions) seen over time in the MS Access forum.
    Last edited by Teddy; 04-17-06 at 13:23.

  4. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What is DBForums?

    DBForums is a free forum supported by and for our members. Our active members are here because they enjoy helping folks out (and occassionally need a lifeline ).

    What ISN'T DBForums?

    DBForums may be helpful in a variety of situations, but it is not the one-stop shop for every situation. Here are a few things the MS Access fourm is not
    • Paid Tech Support:
      We are not a paid tech support forum. Please keep this in mind when evaluationg responses to your questions. It is unrealistic to hold an expectation of service above and beyond that of a forum comprised of volunteer members who share their knowledge, experience and solutions just because they like to help. If you expect or demand solutions from our members, you will be unlikely to receive any useful information. If your expectations are flagarantly obnoxious/unrealistic, expect your post to be moderated.
    • A Substitute for Talking With Your Professor/Classmates:
      Homework questions are ok. Everybody has to start somewhere, and school isn't all that bad of a place to begin. If you are stuck with a specific problem or concept, feel free to post and we will assist to the best of our ability. However, attempting to coerce members into completing your homework for you is definately NOT ok. If you do so, your post will be moderated. If you continue to do so, you will be banned.
    • Classified Section:
      Job offers or positions should be posted in the Job Opportunities section. If you find yourself in a position where you MUST demand an immediate solution, you will probably have to pay for it. The Job Opportunities forum isn't a bad place to ask. Please do not post open positions or contract opportunities in the Access forum. If you do so, your post will be moderated. If you continue to do so, you will be banned.
    Last edited by Teddy; 04-17-06 at 13:23.

  5. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    How Do I Ask A Question?

    You may notice that some folks get their questions answered almost immediately while others will languish for days before receiving their first reply. Contrary to popular belief, this rarely has anything to do with us playing favorites (sometimes it does, but that's only if the poster is exceptionally awesome). In general, the reason one question gets a plethora of support while another gets squat is because of how the question was asked.


    Some of our members are quite skilled in a variety of disciplines, some are outright experts, none are cairvoyant. When posting your question, please include:
    • POST YOUR ACTUAL QUESTION IN THE THREAD TITLE. The fact that you are posting here in the first place is a good indicator that you "NEED HELP PLZ!11!". You are more likely to receive timely assistance if there is something meaningful in your thread title that will allow someone scanning the forums to identify your post as an area of their expertise.
    • What version of Access you're using
    • The business logic or problem you are trying to solve with your application
    • The SPECIFIC behavior or lack thereof that describes your problem
    • If you're posting regarding an error, please, post the error. C'mon, seriously folks.
    • Post your current solution, what it's doing that you don't like AND an example of your desired results
      For general SQL/table design/query issues, this would include a full description of the tables involved; Sample data; and sample result records.


    Also, we do not know anything about your project or application unless you explicitly tell us about it. That means a question such as, "The client button doesn't populate the third insurance claim selector with the code!!!" will go unanswered. We don't know what you're talking about, sorry.

    In short, give us half a chance at actually being able to answer your question. Make it as easy as possible, and you're FAR more likely to get a response.

    When you have arrived at a solution to your problem, please report back to the thread to let us know what did the trick. I know it cuts into your time a bit and isn't necessary once you solved your issue, but gee golly it gives us the warm fuzzies and helps out the next poor schmoe who comes along with the same question. As a bonus, we'll take a shine to ya'
    Last edited by Teddy; 12-21-06 at 17:50.

  6. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Get Selected Values From A Listbox

    For the purposes of this FAQ, we will assume a form with two controls:

    lstMyListBox - Listbox control
    btnDemo - Command Button

    Listboxes offer three "multi-select" modes to control how a user may interact with the listbox. The first mode, "none", only allows the user to select one item at a time. To evaluate the current selection with lstMyListBox's multi-select property set to "none", we could use the following code:

    Debug.Print Me.lstMyList.Column(0, lstMyList.ListIndex)

    If lstMyListBox is set to either "simple" or "extended" multiselect, we have to approach the issue a little differently. Listboxes have a collection called "ItemsSelected". This collection contains all of the currently selected rows. When we iterate through the ItemsSelected collection, we will receive the index of the selected items. Here is an example of how that might look:

    Code:
    Private Sub btnDemo_Click()
    Dim varItem As Variant
    
    For Each varItem In Me.lstMyList.ItemsSelected
        Debug.Print lstMyList.Column(0, varItem)
    Next varItem
    
    End Sub
    Dim varItem As Variant

    This line creates a variable that will hold each index as we iterate through the ItemsSelected property.

    For Each varItem In Me.lstMyList.ItemsSelected

    This line tells access to go through the ItemsSelected property one-at-a-time and place the contents into varItem.

    Debug.Print lstMyList.Column(0, varItem)

    This prints the contents of the selected row to the intermediate window

    Next varItem

    Get the next selected row.

  7. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Last edited by pkstormy; 07-19-07 at 18:55.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  8. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    2 Versions of MSAccess problems, missing code:

    If you have 2 versions of MSAccess or get a wierd error when opening your form, report or mdoule and find that some of your code is missing, try looking at these posts:

    http://www.dbforums.com/showthread.php?t=1620598
    http://www.dbforums.com/archive/inde...t-1212300.html
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  9. #8
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Microsoft Jet Utilities are available for download at Microsoft support.

    In addition, the Jet Compact Utility is also available for download.

    Finally, here is "How to troubleshoot and repair a damaged Jet 4.0 database in Access 2000".
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  10. #9
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    How Do I Ask A Question?
    Part II

    The Tom Kyte Blog: How to ask questions
    Last edited by healdem; 06-09-16 at 03:18.
    I'd rather be riding on the Tiger 800 or the Norton

  11. #10
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    If you are asking for detailed help on a matter of query design then you will get a better response if you supply the DDL (the create table statement)
    ideally tables with populated sample data. you make it harder for people to respond if you expect them to create tables on your behalf. Sometimes for the really complicated questions it can take a while to set up a db, input data. if it is that complex and you don't provide the sample data you are at risk of sending the message your time is to important

    if you post a db on the forum then bear in mind that it becomes public within 30 minutes or so, as the site gets indexed. so don't attach any db with sensitive or private information.

    if you do post a db here there are various steps you need to take. the site doesnt' accept a native Access file (MDB or ADDB) as an attachment you need to either rename it or compress it into a ZIP or similar.

    the suggested steps are:-
    take a copy of your db
    open that copy, delete any stuff that isn't relevant to your question
    anonymise any sensitive data
    then compact and reapir the db to reclaim unused space within the Access db
    quite the db
    using file manager, right click the db and compress into a zip file
    then attach that zip file to a post

    in that post make it clear which form/report/query you are struggling with, don't expect someone to wade through god knows how many forms/reports/queries to work out what needs looking at.

    in your post try to abstract the problem into what is actually happening or not as the case maybe. make certain your language is appropriate, there's no point in focussing on your business processes if thoise processes are not clear to others
    I'd rather be riding on the Tiger 800 or the Norton

  12. #11
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    To second and complete healdem's last post, you can use the following function to obtain the DDL query of an existing table in your database:
    Code:
    Function GetDDL(ByVal TableName As String) As String
    
        Dim dbs As DAO.Database
        Dim tdf As DAO.TableDef
        Dim fld As DAO.Field
        Dim strSQL As String
        Dim strType As String
        Dim i As Long
        
        If DCount("*", "MSysObjects", "name='" & TableName & "'") > 0 Then
            Set dbs = CurrentDb
            Set tdf = dbs.TableDefs(TableName)
            For i = 0 To tdf.Fields.Count - 1
                Set fld = tdf.Fields(i)
                If i = 0 Then
                    strSQL = strSQL & Space$(1) & "[" & fld.Name & "]"
                Else
                    strSQL = strSQL & "," & vbNewLine & vbTab & Space$(2) & "[" & fld.Name & "]"
                End If
                Select Case fld.Type
                    Case dbBinary:      strType = " BINARY"
                    Case dbBoolean:     strType = " BIT"
                    Case dbByte:        strType = " TINYINT"
                    Case dbCurrency:    strType = " MONEY"
                    Case dbDate:        strType = " DATETIME"
                    Case dbDouble:      strType = " DOUBLE"
                    Case dbFloat:       strType = " FLOAT"
                    Case dbInteger:     strType = " SMALLINT"
                    Case dbLong:        If (fld.Attributes And dbAutoIncrField) <> 0 Then strType = " COUNTER" Else strType = " INTEGER"
                    Case dbLongBinary:  strType = " IMAGE"
                    Case dbMemo:        strType = " MEMO"
                    Case dbNumeric:     strType = " FLOAT"
                    Case dbSingle:      strType = " SINGLE"
                    Case dbText:        strType = " TEXT(" & fld.Size & ")"
                    Case dbTime:        strType = " DATETIME"
                    Case dbVarBinary:   strType = " BINARY"
                    Case Else:          strType = " <Unkown or unsupported data type>"
                End Select
                strSQL = strSQL & strType
            Next i
            strSQL = strSQL & vbNewLine & vbTab & ");"
            strSQL = "CREATE TABLE " & "[" & TableName & "]" & vbNewLine & vbTab & "(" & strSQL
        Else
            MsgBox "Table " & TableName & " does not exist in the current database.", vbInformation, "Table not found"
            strSQL = ""
        End If
        GetDDL = strSQL
        Set tdf = Nothing
        Set dbs = Nothing
    
    End Function
    1. Copy the function in a standard module (existing or create a new one).
    2. Open the immediate window (Ctrl+G).
    3. Type in:
    Code:
    ? GetDDL("TableName") <Enter>
    where TableName is the name of the table for which you want to retrieve the DDL query text.
    Have a nice day!

Posting Permissions

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