Search results

  1. Elana

    Check if item is selected on list

    Is the bound column for the listbox a numeric field or text? It could be that the value of the field is sometimes null, but sometimes it might be an empty string i.e., "". So you could add another check to handle both possibilities: If isnull(me.listbox) or me.listbox.value = "" then...
  2. Elana

    records in subform

    Try this: dim dbs as database dim rst as recordset dim response as integer set dbs = currentdb() set rst = forms!YourMainForm!YourSubform.form.recordsetclone if rst.recordcount = 0 then response = msgbox("There are no invoices against which to post this payment. Do you want to post a...
  3. Elana

    Before Update

    Try this: If Me.FrameImported = 2 And IsNull(txtCountry) Then MsgBox "You must enter a country" Cancel = True Exit sub else 'do nothing end if If Me.FrameModified = 2 And IsNull(txtModified) Then MsgBox "You must enter a description" Cancel = True exit sub Else 'do nothing End If End Sub
  4. Elana

    counting records on another form

    Okay - try this - I placed this under a command button to test it, but you can place it under the On Current property of the form: Dim dbs As Database Dim rst As Recordset Set dbs = CurrentDb() Set rst = Forms![YourMainForm]![YourSubForm].Form.RecordsetClone...
  5. Elana

    counting records on another form

    The only difference is that you need to make sure you are referring to the subform correctly - check out the Microsoft Knowledge Base article 113352.
  6. Elana

    Locking existing records in form

    I have a similar situation - I want my users to view previously posted entries, but not be able to edit them. So, for the OnCurrent event for the form, I placed code: if me.newrecord then me.field1.locked = true me.field2.locked = true etc. else me.field1.locked =...
  7. Elana

    Looping Through Listbox

    Thanks - that works great!
  8. Elana

    Pop up form if previous field = 1

    First, I think you need to tweak the On Current event a little. Private Sub Form_Current() If Me.NewRecord Then Me.q1c.Visible = False ElseIf Me.NewRecord = False And Me.q1 = "1" Then Me.q1c.Visible = True ElseIf Me.NewRecord = False And Me.q1 <> "1" Then...
  9. Elana

    Looping Through Listbox

    Loop through list box contents help needed I've got a list box that shows all locations for a particular owner (as selected in another combo box on my form). I want to be able to programatically determine whether any of the locations shown in the listbox are in California. Here is my SELECT...
  10. Elana

    Pop up form if previous field = 1

    First, make the Visible property of field Q1C = no. Then on the AfterUpdate event for field Q1, place code: If me.q1 = 1 then me.q1C.visible = true else ' do nothing (comment this line out) end if Then on the OnCurrent property of the form, place this code: me.q1C.visible = false That...
  11. Elana

    Openreport Method - 'Where' Argument Help

    I figured it out. I wasn't enclosing the variable in quotes - here is one solution to the problem: strWhere = "[ChangeNoProp] = """ & strPropEndtNo & """" Works great -
  12. Elana

    Openreport Method - 'Where' Argument Help

    Because I have several reports to run from this code and I don't want to make a query for each one.
  13. Elana

    Openreport Method - 'Where' Argument Help

    I am having fits trying to concatenate a variable into my Where argument. I've tried everything to fix it, but no luck. I have a report that will print whatever record is selected in my listbox located on form 'frmPrintMenu.' The bound column of the listbox is not the criteria for this...
  14. Elana

    Refreshing a Form

    I would suggest you place code behind the "on current" event of the form so that for each new record, the controls return to their disabled state.
  15. Elana

    Form Refresh

    The TimeRecorded field can be entered every time a call is logged in by setting the BeforeUpdate event of the form to: me.timerecorded = now() Then it will show the time the record was entered in the log.
  16. Elana

    Determining selection in unbound list box

    Okay, tell me what columns you have in your listbox - [ID] should be the bound column.
  17. Elana

    Determine Highest Value in Unbound Listbox

    Thank you! I always seem to have trouble with those quotation marks...it works great now!
  18. Elana

    Determine Highest Value in Unbound Listbox

    Hi - I have a form called "frmAddBldg" and a listbox on that form called "lstShowBldgs". The listbox displays all buildings associated with the master location that has been selected. When a user is adding a building to a master location, I want the next available building number for that...
  19. Elana

    Determining selection in unbound list box

    You need to refer to the name of the listbox control on your form, instead of the form itself; i.e.: [ID] = [Forms]![View_Edit_Action_Item]![yourlistboxname] It will refer to the currently selected item in the listbox. Cheers
  20. Elana

    MS Access Start-up Question

    Have you changed your startup options to not show the database window?
Back
Top Bottom