Form can not display search results

J

Josh

I have been working on this for a while, so please excuse my lack of cohesive
thoughts... I will be more than happy to work with anyone who would like to
tackle this issue with me.

Using Access 2000, I am attempting to create a sophisticated search form
that displays its' results in another form. The main issue I have at the
moment is trying to get the data that was selected from a Microsoft Listview
Control to display on another form. The form, SiteFrm, has a Query as a
recordsource and is filtered by an id that is unique. Here is what I have
tried so far:

On SiteFrm

Tried to make a button that when clicked referenced Me.ApplyFilter
Tried to make a text box that used Me.Filter = ID entered in from textbox

Everything I do on this form does not load any fields. All the textboxes on
this form are bound to the RecordSource, and I assumed when the
Filter was updated, that the RecordSource would Recalc or something similar
but it did not.

In a Module that processes the Search Forms findings (Grabs that ID, tab
name, some other stuff)

Tried "DoCmd.OpenForm m_strFormName, , , stLinkCriteria" with the proper
form name - I get the OpenForm action was cancelled.
Tried "Forms.Item(m_strFormName).RecordSource = temp & temp1 & temp2" with
the a proper SQL string - I get the You cancelled the previous operation.

I also tried to force that ID into the following combobox and try to trigger
the after update and piggyback that functionality since it works.
That did not work as well


The only way to get the SiteFrm to properly work is to get that ID from a
combo box from the Main Menu, then clicking a button that does this:

cbo AfterUpdate information

cboMtrNum.SetFocus
tempMS_systemid = cboMtrNum.Value
tempSQLMainMenuRecordSrc = "SELECT Projects.Project_Name,
Projects.P_MasterBillingNum, Master.MS_SiteMtrNum, Master.MatterName, " & _
"Master.ProjectID, Master.MS_systemid FROM Master INNER JOIN Projects ON
Master.ProjectID = Projects.P_systemid "

tempSQLMainMenuRecordSrc = tempSQLMainMenuRecordSrc & " WHERE
Master.MS_systemid = " & tempMS_systemid & " AND Master.ProjectID = " &
g_ProjectID

Me.RecordSource = tempSQLMainMenuRecordSrc
txtMtrName.ControlSource = "Master.MatterName"
cboMtrNum.SetFocus
cboMtrNum.Value = tempMS_systemid

g_CurrentMatterNo = cboMtrNum.Text
cboCNLAssetNo.SetFocus
cboCNLAssetNo.Value = tempMS_systemid



Command_Click basic information
stDocName = "SiteFrm"

stLinkCriteria = "[MS_systemid] = " & Is_MS_systemid_Null(cboMtrNum.Value)
DoCmd.OpenForm stDocName, , , stLinkCriteria
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top