Solved Parameter Dialog on Open Form

silentwolf

Active member
Local time
, 17:57
Joined
Jun 12, 2009
Messages
655
Hi again,

sorry just came accross an error in my openForm Event

I open another form within my application

Code:
    If IsNull(Forms!frmCustomers!CustomerID) Then
        MsgBox "Bitte wählen Sie zunächst einen Datensatz aus."
        Exit Sub
    End If
    
    DoCmd.OpenForm "frmOrders", datamode:=acFormEdit, _
                    WindowMode:=acNormal, WhereCondition:="CustomerID=" _
                    & Forms!frmCustomers!CustomerID
    Me.Requery

    DoCmd.OpenForm "frmOrders", acNormal
    DoCmd.GoToRecord , , acNewRec

    Forms![frmOrders].Form![CustomerCombo] = Me.CustomerID

However the Orders Form opens after I have been asked to enter an CustomerID "Parameter" which I left blank and continioued to run my code.

The Orders Form opens with the correct CustomerID.

How can I get rid of this dialog?


Can't seam to find where the Error is causing this.

Has someone an idea where I can find it?

Checked the Controls on each form but they seam to be fine.
 
Check the record source of the form, the order by and filter on properties, and any combobox or listbox row sources.
 
Hi DBguy,

thanks for your reply!

Currently I do have in the Orders Form a combobox control. "CustomerCombo" Recordsource = "
SELECT qryCustomerSelection.CustomerID, qryCustomerSelection.Kunde
FROM qryCustomerSelection;"


Also a textbox Control CustomerID Recordsource is from the Table.

I will continou to check !
 
Hi Pat,

thanks I will work through your suggestion and get back to you!

Cheers
 
Hi just a quick update on this topic.

The issue was in the query where I used a Alias and that seamed to caused the issue.

Cheers for pointing all out also to Pat for the new Code!

Cheers
 

Users who are viewing this thread

Back
Top Bottom