A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using form for searching, and then for changing records



 
 
Thread Tools Display Modes
  #1  
Old November 6th, 2009, 02:19 PM posted to microsoft.public.access.forms
Smoki
external usenet poster
 
Posts: 54
Default 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  
Old November 7th, 2009, 11:50 AM posted to microsoft.public.access.forms
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default 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  
Old November 9th, 2009, 09:31 PM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.