![]() |
| ||
| Adding a search function OK im new to this so bear with me. I need to add a search function to my project. I need to input a value into a textbox, click a submit button and a screen needs to appear with the results Ive got a the following code but i get errors : Private Sub cmdsubmit_click()what am i missing here. The errri comes up on the "Data1.Recordset.FindFirst.store" line |
| ||
| Re: Adding a search function I'm pretty sure that you can't use a variable name as a property of an object..... you could try this instead: Data1.Recordset.FindFirst(store) ' might work |
| ||
| Re: Adding a search function didnt work |
| ||
| Re: Adding a search function what entity you are searching in you access? |
| ||
| Re: Adding a search function if using ADO that can be done by using SQL queries using LIKE search. |
| ||
| Re: Adding a search function I have to use access due to college criteria. Im searching the "tittle" in the database. usualy i say : data1.recordset.findfirst.store this problem also occurs when attempting to add a record |
| ||
| Re: Adding a search function is the title is entity if entity use this data1.recordsource = ("Select * from name_of_the_table where title - '" & store 7 "'") regards Ryan Riel |
| ||
| Re: Adding a search function this is driving me mental lol. My code is as follows but cant get it working.Do i need to have a hide/show function also to display the results? Private Sub cmdsubmit_click() 'Declare local variables Dim store As String 'Get the search information store = txtsearch.Text mycriteria = "title =" & "'" & store & "'" Data1.Recordset.FindFirst mycriteria If Data1.Recordset.NoMatch Then Data1.Recordset.MoveFirst MsgBox "Record not found", vbExclamation, "Error" End If End Sub |
| ||
| Re: Adding a search function store = txtsearch.Text mycriteria = "title =" & "'" & store & "'" Data1.Recordset.FindFirst mycriteria data1.recordset.movenext |
| All times are GMT -4. The time now is 4:23 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC