Search results

  1. G

    Distribute field value into a listbox in 2 or 3 columns

    Hello. i want to display a single field values in list box with query as row source. the query will produce variable number of records or rows. sometime 1, sometimes 3 or 6 my thought is to distribute these records/row into list box column. for example: if query = 1 then listbox column = 1...
  2. G

    recordset.sort not working?

    hello. i am trying to sort a recordset but it is not working: Set rst = db.OpenRecordset(strSQL) rst.Sort = "CountOftPrimaryCrop Ascending" 'ASC has same effect rst.MoveFirst Do Until rst.EOF Debug.Print rst.Fields("CountOftPrimaryCrop") rst.MoveNext immediate...
  3. G

    Extract data from query

    Hello. i am trying to extract data from a query but access help is confusing (sorry, my fault). part of code when form loads, my questions is bold: 'query criteria vOrgCode = Me.tOrgCode 'sql statement strSQL = "Select tblMembers.tOrgCode, tblMembers.tGender...
  4. G

    How do i know when a control has focus?

    hello. in the following code, i am trying to determine if command button has the focus: Private Sub lstOrg_LostFocus() If Me.cmdEditOrgProfile_GotFocus() Then Exit Sub Else Me.cmdEditOrgProfile.Enabled = False End If End Sub the second line returns error...
  5. G

    If End If Construct

    Hello. i have this code: Private Sub cboOrgNick_LostFocus() 'making auto-populate textbox with incremental numbering 'if combo box is not empty If Me!cboOrgNick = "" Or Me!cboOrgNick = Null Then Exit Sub 'do nothing or Else 'get new number...
  6. G

    DCount() not working

    Good day. i am trying to count records on table based on criteria, then show it in unbound text box. i try this code for it: Me.myText = DCount("tFName", "tblMembers", "[tOrgNick] = 'Me.lstOrg.Column(0)'") it does not work. then i try this one: Dim nShow As Integer Dim tShow As...
  7. G

    Two List Boxes Problem

    hello again. i'm trying to set my main form, with 2 list boxes. the first is list of organizations and the other is supposed to show list of members of that organization. i have this code to run in the click event in the first list: Private Sub lstOrg_Click()...
  8. G

    increment number error

    i have these code to auto generate member number but the highlighted line generate error 94 - invalid use of NULL: Private Sub cmdGetNumb_Click() 'On click of button a new Member Number is generated and 'focus is moved to tFName field. Me![nMembNum] = NewMembNum() Me![tFName].SetFocus...
  9. G

    how do i test code?

    hello. sorry for the noob question. in foxpro, i can write code and make it run to test if it is right. can i do that in access?
Top Bottom