Both filter and Combo Box stopped working (1 Viewer)

jleval

Registered User.
Local time
Today, 07:49
Joined
May 16, 2012
Messages
53
I have a form that has a command button that allows for adding notes to the form. The notes table is seperate from all other tables. It is not linked to any other forms. My boss will not allow it.

So, I have a couple of things going that allow the record I am viewing to know if there is a note attached to it.

The on current event holds this

Code:
If Not Me.NewRecord Then
    If DCount("NoteID", "Notes", "[PartNumber]=" & Chr(34) & Me.PartNumber & Chr(34)) > 0 Then
        Me.CmdComment.Visible = True
        Me.lblNotes.Visible = True
    Else
        Me.CmdComment.Visible = False
        Me.lblNotes.Visible = False
    End If
End If

Which works just fine. This tells me there is a note attached to the record. It pops up a command button that allows me to vies the note.

the command button use to work. Once I clicked it this code would execute:

Code:
If IsNull(Me.cboTraceNumber) Then
    DoCmd.OpenForm "frmNotes", , , "[PartNumber]=" & Chr(34) & Me.cboPartNumberTest & Chr(34)
 Else
    DoCmd.OpenForm "frmNotes", , , "[PartNumber]=" & Chr(34) & Me.cboPartNumberTest & Chr(34) & " AND [TraceNumber]=" & Chr(34) & Me.cboTraceNumber & Chr(34)
End If

Out of nowhere this stopped working and not only that, the combo boxes that used to be able to lookup any note dont work either. Does anyone have any idea what is going on here. I didn't make any real changes except with the on open even which goes like this:
Code:
If NewNote = True Then
 Me.NoteTakerName.Locked = False
 Me.txtNoteDate.Locked = False
 Me.CustomerName.Locked = False
 Me.txtNoteChangedDate.Locked = False
 Me.ToolType.Locked = False
 Me.PartNumber.Locked = False
 Me.TraceNumber.Locked = False
 Me.PurchaseOrderNumber.Locked = False
 Me.InvoiceNumber.Locked = False
 Me.txtComments.Locked = False
 NewNote = False
    If OpenNotesFromToolMeasurements = True Then
        Me.ToolType = Forms![frmToolMeasurements]![ToolMeasurementCutterToolMeasurement Subform]!ToolType
        Me.PartNumber = Forms![frmToolMeasurements]![ToolMeasurementCutterToolMeasurement Subform]!PartNumber
        Me.TraceNumber = Forms![frmToolMeasurements]![ToolMeasurementCutterToolMeasurement Subform]!TraceNumber
        Me.BatchID = Forms![frmToolMeasurements]![ToolMeasurementCutterToolMeasurement Subform]!BatchID
        OpenNotesFromToolMeasurements = False


    ElseIf OpenNotesFromBatch = True Then
        Me.ToolType = Forms![frmBatch]![CutterToolMeasurement Subform]!ToolType
        Me.PartNumber = Forms![frmBatch]![CutterToolMeasurement Subform]!PartNumber
        Me.TraceNumber = Forms![frmBatch]![CutterToolMeasurement Subform]!TraceNumber
        Me.BatchID = Forms![frmBatch]![CutterToolMeasurement Subform]!BatchID
        Me.PurchaseOrderNumber = Forms![frmBatch]!PurchaseOrderNumber
        Me.InvoiceNumber = Forms![frmBatch]!InvoiceNumber
        OpenNotesFromBatch = False
    End If
Else
 
End If
This is used to populate the form when the new note button is pressed. Not the view note button, which is the one that applies the where condition. This should not even affect the filter.

I also tried changing the filter on load, etc in the properties. Noting helped

:banghead:
 

boblarson

Smeghead
Local time
Today, 06:49
Joined
Jan 12, 2001
Messages
32,059
Did you either rename your controls or move them to a tab control? If renamed then you would need to go into the VBA and move the code to the right event because it won't do it automatically unless you have Name Auto Correct (also known as Auto Corrupt) on.

If you moved them to a tab control you need to go to the events tab on the properties dialog for each control and make sure [Event Procedure] is selected as that becomes unselected when moved to a tab control.
 

jleval

Registered User.
Local time
Today, 07:49
Joined
May 16, 2012
Messages
53
I didn't change any names. I have several controls. several combo boxes that look up based on a field. None of them seem to work now. And neither does the filters. Could you possibly suggest another way to obtain records from notes. I don't know how it just stopped working. I didn't make any changes
 

boblarson

Smeghead
Local time
Today, 06:49
Joined
Jan 12, 2001
Messages
32,059
Does any code work? Did you move the database to a non trusted location maybe?

Other than that all I can suggest is to have you run Compact and Repair then right click on the file and select Send To > Compressed Folder and then upload it here so we can take a look.
 

jleval

Registered User.
Local time
Today, 07:49
Joined
May 16, 2012
Messages
53
I never could figure it out so I created a new form. I must have made some strange changes??? It works fine now though!!
 

Users who are viewing this thread

Top Bottom