SteveL13
asked on
Listbox doesn't open to a new (blank) record when form opens for new record input
I have a form that opend for a new record input. On this form is a listbox. But when the form opens the listbox is not empty and should be. What is wrong with my code... ?...
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmProject"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms!frmProject.List136.R equery
Forms!frmProject.txtDrops = ""
Forms!frmProject.txtJobN.S etFocus
Exit_Command12_Click:
Exit Sub
Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmProject"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms!frmProject.List136.R
Forms!frmProject.txtDrops = ""
Forms!frmProject.txtJobN.S
Exit_Command12_Click:
Exit Sub
Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
What is the rowsource of the listbox?
ASKER
Is a query... Here is the SQL code:
SELECT Format([tblProjectDetail]. [DetailID] ,"0") AS [Drop], tblProjectDetail.JobN, Format([tblProjectDetail]. [Qty],"0") AS Qty, tblProjectDetail.DropDueDa te AS [Due Date], tblProjectDetail.Complete, tblProjectDetail.Billed, tblProjectDetail.Name, tblProjectDetail.Cancelled
FROM tblProjectDetail
WHERE (((tblProjectDetail.JobN)= [Forms]![f rmProject] ![txtJobN] ))
ORDER BY tblProjectDetail.Complete DESC , tblProjectDetail.DropDueDa te;
SELECT Format([tblProjectDetail].
FROM tblProjectDetail
WHERE (((tblProjectDetail.JobN)=
ORDER BY tblProjectDetail.Complete DESC , tblProjectDetail.DropDueDa
I don't understand why you are not getting an error.
Does txtJobN have a default value?
Does txtJobN have a default value?
ASKER
No it does not.
Perhaps you should take a step back and explain exactly what this system is supposed to be doing...?
ASKER
When I open the form for a new record entry, the lisbox on that form should be empty.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.