If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Using form for searching, and then for changing records
Hello,
I need to make form, which I will use first to search from tables, and when I find it, I need to change some paramethers about it. How to do this? I already made form, but when I change some paramethers, then this paramethers has been changed on every place in table, not only in that specific row! What to do? Smoki |
#2
|
|||
|
|||
Using form for searching, and then for changing records
hi Smoki,
Smoki wrote: Hello, I need to make form, which I will use first to search from tables, and when I find it, I need to change some paramethers about it. How to do this? I already made form, but when I change some paramethers, then this paramethers has been changed on every place in table, not only in that specific row! What to do? Use two forms, one for searching and one for editing the data. In the search form use a continuous form with a form header and footer. In the header you can place your search boxes (e.g. txtSearchName), and in the footer the edit buttons (e.g. cmdEdit). Use the On Change event of the box to narrow down your results: Private Sub txtSearchName_Change() Dim Criteria As String Criteria = Replace(Nz(txtSearchName.Value, ""), "'", "''") Criteria = "[Name] LIKE '*" & Criteria& "*'" Me.Filter = Criteria Me.FilterOn = True End Sub Use the buttons Click event to open your form: Private Sub cmdEdit_Click() Dim Criteria As String Criteria = "[Id] = " & Me![Id] DoCmd.OpenForm "frmEditData", , ,Criteria End Sub Take a closer look at the OpenForm method and use the criteria parameter, not the filter parameter (the position in the parameter list is important, otherwise use named parameters). Your record source of the search form must include in this example at least a [Name] field and an [Id] field - the primary key field. If you are using Access 2007 you may use a split form instead. mfG -- stefan -- |
#3
|
|||
|
|||
Using form for searching, and then for changing records
but when I change some paramethers, then this paramethers has been changed
on every place in table, I bet this is not true. Check the data in the table directly, not using a form or query, but opening the table and looking at that field (normally you would not do this) I think you will find the data has not changed. You see I am sure you did not bind the textbox to the field. Post the Record Source for the form. Open in design view, right click and scroll down to select Properties. If the Record Source is a query then open the query in design view, click on VIEW - SQL View, highlight all, copy, and paste in a post. -- Build a little, test a little. "Smoki" wrote: Hello, I need to make form, which I will use first to search from tables, and when I find it, I need to change some paramethers about it. How to do this? I already made form, but when I change some paramethers, then this paramethers has been changed on every place in table, not only in that specific row! What to do? Smoki |
Thread Tools | |
Display Modes | |
|
|