473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using a form to search records

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
3 1966

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Pete | last post by:
I'm currently doing a database that uses comboboxes to look up records in other tables, whether they be lookup tables or otherwise. When a user needs to add an item to one of these tables, the...
9
by: Christopher Koh | last post by:
I will make a form which will search the database (just like google interface) that will look/match for the exact name in the records of a given fieldname. Any suggestions on how to make the code?
1
by: Cillies | last post by:
Does any one know if it is possible to search a database by using combo boxes from a form. I have a form which includes comboboxes. I want to know If I can use these combo boxes to search, i.e....
7
by: John | last post by:
hi, i have created a search form, and i want to search for a specific item in a field. e.g. i have a field called colour, which has record1 = 'red, blue, green' and another record2 = 'red' ...
2
by: Robert | last post by:
I am trying to give the user dynamic search capabilities to select almost any record in the database from criteria they select. Everything seems to work except when I open the display form to...
1
by: Anne DeBlois | last post by:
I am working on a form (details) and I need my form to allow to search on some char fields. I have a button next to the field users can search. The button calls a pop-up form to enter the...
2
by: kev | last post by:
Hi Folks, I have created a search query in which it successfully returns correct results. When there are no records returned, instead of giving out a blank form i created a pop-up msg which is...
6
by: JonC | last post by:
I am developing an Access database and need to be able to print a form with various selections made as it appears on screen. The standard way of doing this would be to create a report based on the...
3
by: WiseG1rly | last post by:
Hey everyone! I am completley new and I will start off by saying that I am not a programmer - figuring out this search took so long! I am debugging now and would appreciate any help :) ...
4
by: Evanescent | last post by:
Hi Guys, I am trying to create a form which allows the users to retrieve records based on the values entered or chosen in the various combo boxes and textboxes, such as the customer's name, invoice...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.