Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter value problem 1

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
An application Acc2003 which ran okay on a PC using XP, now fails on a new PC using XP. When a form is opened a dialogue box appears -

Enter Parameter Value

Forms!Mainform1.Form.ID1

The form is bound to a table. A textbox exists named ID1 and is bound to the ID1 field (Primary Key) of the bound table. Any ideas why this would happen? I have checked the control is there, and bound okay. Its visible property is set to false but its always worked okay. Thanks
 
i would check the properties of the bound table to see if it has a default sort value that has been renamed or does not exist.

However, it sounds like a query parameter is missing. Are there any queries based on the same control that is running before the form loads entirely.

.....
I'd rather be surfing
 
Thanks both. The onopen and load events of the form only close the previous form (Menu) and set certain modes to be enabled dependant on user level. There is a listbox on the form with integral query, which gets filled after a user enters text. It does not get queried on load. The database is networked, this is the front end, other older PC's don't have this problem? Thanks
 
i would place a breakpoint in the code and step through to see exactly when the paramter request is thrown.
Check the open event and close events of the other forms.

Post the code that triggers the request.

Is there a subform?



Somewhere there is a reference to this form's control that is being called before or after this form is open.

.....
I'd rather be surfing
 
Thanks. Seems strange it does not go wrong on my PC, or the users old ones. Maybe somethings working faster and tripping up? Anyway the code for the Form is:

Private Sub Form_Open(Cancel As Integer)

SECLEVEL = 1

If SECLEVEL = 0 Then
DoCmd.Close
DoCmd.OpenForm "MainMenu"
Exit Sub
End If

If SECLEVEL = 1 Or SECLEVEL = 2 Then
Me.Edit2.Enabled = True
Else
Me.Edit2.Enabled = False
End If

Me.List24 = Null
Me.IPS = ""
Me.IPS.SetFocus
LZT = 0
Me.RTH.Left = Me.MC.Left
Me.Added.Width = 0
Forms!MainForm1!Subform1.Visible = False
Forms!MainForm1!Subform1.Left = Me.Box90.Left - 310
Forms!MainForm1!Subform1.Width = 0

End Sub


Private Sub Form_Load()
Dim blRet As Boolean

fAccessWindow "Minimize", False, False

blRet = MouseWheelOFF(False)
DoCmd.Maximize

DoCmd.Close acForm, "MainMenu"

End Sub


The Listbox on the form fills only when user enters data
The SQL is:

SELECT TXMASTERS.ID1, Val(Right([Barcode],9)) AS [AT], TXMASTERS.Barcode
FROM TXMASTERS
WHERE (((Val(Right([Barcode],9)) & '') Like Val([FORMS]![MainForm1].[LNAME].[CAPTION]) & '*'))
ORDER BY TXMASTERS.Barcode;


Thanks
 
Forgot to add, there is a timer event which puts the date/time on the form. Regards
 
so, if you set a breakpoint and step through the code, what line does the prameter request get triggered on?

.....
I'd rather be surfing
 
The list only gets queried after input of text into textbox IPS. Unfortunately I don't have the PC that has the problem here to set breakpoints, the user has an MDE version.
 
I set a breakpoint in my program on Me.IPS=""
and found on Me.IPS it left to do the Form Load event,
and then went into the form resize event

Private Sub Form_Resize()
DoCmd.Maximize ' This event makes the form maximise if a user clicks the form border
End Sub

It then returns to:

LZT = 0
Me.RTH.Left = Me.MC.Left
Me.Added.Width = 0
Forms!MainForm1!Subform1.Visible = False
Forms!MainForm1!Subform1.Left = Me.Box90.Left -310 Forms!MainForm1!Subform1.Width = 0


End Sub

I moved the IPS setfocus to the end. Otherwise nothing seems to fire the parameter query. I have had rogue parameter query requests in the past, seems some rubbish gets left in Access even after deleting.
 
you cannot set the focus to a control until the form is open and loaded, so when you attempt to set teh focus in the open sub it has to complete the load sub. I would move the set focust o the last call in your open sub. See if that helps.

Since this fomr has a subform, I would check the subform for its base query etc to see if anything is referencing the main form. Like is it linked by a child master field.

I am just shooting in the dark here, I don't think I can help much more wihtout stepping through the code on the problem machine. I might try a reinstalation to see if that fixes it. The database can sometimes get corrupted on local workstations and they need to be reinstalled or repaired.

sorry

.....
I'd rather be surfing
 
The subform is in a child relationship. Stepping through in debug seems to flow okay from the mainform being called to open to waiting for a user input. I will get them to try reinstall with replacement program and see what happens. Nothings easy hey. Thanks again
 
no problem, post back if you find anything, I'll keep watching this thread.

.....
I'd rather be surfing
 
Have a star in the meantime, and thanks. I will let you know what happens further. Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top