By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,471 Members | 2,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,471 IT Pros & Developers. It's quick & easy.

Using a form to search records

P: n/a
I have a form that shows all the contact data from a query of customers.
Each field is bound to a field in the query. If I try to change the
"StoreNumber" or any field as a matter of fact, i get the "ding".

Not sure why I can't change any data here.

My goal was to NOT allow anyone to change this data except the
"StoreNumber", which wouldn't change the data in the recordset, but search
the recordset for the match.

I know I can add a button that opens up an input box, and thru VBA do a
search. but the other way is more elegant.

Is this possible? I was thinking by setting the onchange or onlostfocus
events???
Jul 11 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

John T Ingato wrote:
I have a form that shows all the contact data from a query of customers.
Each field is bound to a field in the query. If I try to change the
"StoreNumber" or any field as a matter of fact, i get the "ding".

Not sure why I can't change any data here.

My goal was to NOT allow anyone to change this data except the
"StoreNumber", which wouldn't change the data in the recordset, but search
the recordset for the match.

I know I can add a button that opens up an input box, and thru VBA do a
search. but the other way is more elegant.

Is this possible? I was thinking by setting the onchange or onlostfocus
events???
Hi John. I am new to Access, but I am poking my nose around seeing if
I can help. One way of doing this might be to split the form by
creating a subform with all of the data you don't want changed. On the
main form, set the StoreNumber field up as a combo box with a lookup
field listing all Store Numbers. In the properties window of that
combo box under Data, set the Auto Expand property to Yes. I don't
know if this is the sort of thing you meant by "elegant" but I hope it
helps.

---Tim Dunne

Jul 11 '06 #2

P: n/a
In my inventory control form, I added a unbound control call Find Part with
the following code allowing the user to search for a part number by typing
into this field.

Private Sub FindPart_AfterUpdate()
Dim rst As Recordset, strCriteria As String

Set rst = Me.RecordsetClone
rst.FindFirst "[Part#] = """ & Me![FindPart] & """"

If rst.NoMatch Then
MsgBox "No entry found for Part: " & Me![FindPart]
Me![FindPart] = Me![Part#]
Else
Me.Bookmark = rst.Bookmark
End If

DoCmd.GoToControl Me![FindPart].Name

Set rst = Nothing
End Sub
"John T Ingato" <jt******@hotmail.comwrote in message
news:12*************@corp.supernews.com...
I have a form that shows all the contact data from a query of customers.
Each field is bound to a field in the query. If I try to change the
"StoreNumber" or any field as a matter of fact, i get the "ding".

Not sure why I can't change any data here.

My goal was to NOT allow anyone to change this data except the
"StoreNumber", which wouldn't change the data in the recordset, but search
the recordset for the match.

I know I can add a button that opens up an input box, and thru VBA do a
search. but the other way is more elegant.

Is this possible? I was thinking by setting the onchange or onlostfocus
events???


Jul 11 '06 #3

P: n/a
Hi John,

If your query consists on two or more tables, you can have consistency
problems at change. Access is quite strict, en won't let you modify the
fileds.
If you change the forms' RecordsetType to "Dynaset (Inconsistent
update)", you have more edit possibilities, but also more
responsibilities on your data consistency.

HBInc.

John T Ingato wrote:
I have a form that shows all the contact data from a query of customers.
Each field is bound to a field in the query. If I try to change the
"StoreNumber" or any field as a matter of fact, i get the "ding".

Not sure why I can't change any data here.

My goal was to NOT allow anyone to change this data except the
"StoreNumber", which wouldn't change the data in the recordset, but search
the recordset for the match.

I know I can add a button that opens up an input box, and thru VBA do a
search. but the other way is more elegant.

Is this possible? I was thinking by setting the onchange or onlostfocus
events???
Jul 11 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.