473,396 Members | 1,895 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,396 software developers and data experts.

Seeing all records on a form when re-opening

Sam
Hello All,
We want our Call Service Representatives to be able to go back and view
all the records in a table on a form. When closing and re-opening the
form the form starts out as record 1 of 1 even though there are records
already entered into the table via the form. Is there anyway to have
the form start out after the last record in the table and allow the CSR
to go back and view what has already been entered into the table? For
example if there are 5 records in the table, after closing and
re-opening the form the form will start out record 6 and the CSR will
be able to go back and view the previously entered records.

Thank you in advance.

May 17 '06 #1
7 2449
Set the form's Data Entry property to No.
It now loads with all records.

Add this to the form's Load event procedure:
If Not Me.NewRecord Then
RunCommand acCmdRecordsGotoNew
End If
The form now loads with all records, but goes to the new one.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Sam" <ar************@pearson.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hello All,
We want our Call Service Representatives to be able to go back and view
all the records in a table on a form. When closing and re-opening the
form the form starts out as record 1 of 1 even though there are records
already entered into the table via the form. Is there anyway to have
the form start out after the last record in the table and allow the CSR
to go back and view what has already been entered into the table? For
example if there are 5 records in the table, after closing and
re-opening the form the form will start out record 6 and the CSR will
be able to go back and view the previously entered records.

Thank you in advance.

May 17 '06 #2
Sam
Thanks Allen! That worked great.

May 23 '06 #3
Sam
Allen (or whoever),
I have one more question. When opening the form with the code above in
the load event procedure the form automatically goes into write mode
not allowing the users to go back and view previous records without
filling in required fields first. Is there anyway around this? Is
there anyway to take the form out of write mode once the code is ran?

Thanks.

May 23 '06 #4
There were 2 solutions.

The first is for adding new records only.

The second allows you to step back to previous records.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Sam" <ar************@pearson.com> wrote in message
news:11********************@g10g2000cwb.googlegrou ps.com...
Allen (or whoever),
I have one more question. When opening the form with the code above in
the load event procedure the form automatically goes into write mode
not allowing the users to go back and view previous records without
filling in required fields first. Is there anyway around this? Is
there anyway to take the form out of write mode once the code is ran?

Thanks.

May 24 '06 #5
Sam
Allen,
Yes I was aware of that. And I used both as I want the form to open
ready to add a new record but still be able to step back to through
previous records. I should have explained this better the first time
as there's more than just this code in the load event - see code below

strQuery = "SELECT * FROM [Get_CSR_Profile]"

Set qdfDef = CurrentDb().CreateQueryDef("", strQuery)
Set rsRecordset = qdfDef.OpenRecordset(dbOpenDynaset)

strContReason = rsRecordset!CONTINGENCY_REASON
strSiteID = rsRecordset!SITE_ID
strLocation = rsRecordset!LOCATION
strCSR_Type = rsRecordset!CSR_TYPE
If rsRecordset.RecordCount <> 0 Then
'Me.CONT_REASON.Value = sRecordset!CONTINGENCY_REASON
Me.SITE_ID_Combo.Value = rsRecordset!SITE_ID
'Me.CUSTOM_LOCATION.Value = rsRecordset!LOCATION
'Me.CSR_TYPE_Combo.Value = sRecordset!CSR_TYPE
End If

The code above populates some fields on the form so the user doesn't
have to re-enter it every time they open thier DB (they all have their
own copy of the DB). Becuase I'm populateing these fields the form
goes into write mode right away. The user is then not allowed to
scroll back through previous records because there are other fields on
the form that are required. My question is, is there anyway around
this? Is there a way to take the form off write mode? Or any other
way?

Thanks and sorry for the confusion.

May 24 '06 #6
Sam
Hi Allen,
I've been doing some research and found you can use the DefaultValue to
set the fields and the form won't go into write mode. But I'm getting
and a runtime error 2447: "There is an invalid use of the .(dot) or !
operator or invalid parentheses". I found some info on this error that
deals with what I'm doing and it says to put quotes around the string.
From another post:


After kicking things around a bit, I realized that I was
seeing a problem with delimiters. I was handling dates
correctly:

txt_Date.DefaultValue = "#" & dtm_MyDate & "#"

but NOT strings:

txt_Name.DefaultValue = MyName

which SHOULD be:

txt_Name.DefaultValue = """ & MyName & """

How can I do this when I'm using values brought in from a table (rather
than a constant string)?

Thanks.

May 24 '06 #7
I am not sure what you mean by "write mode"

If you put this code into the Load event, then presumably you are dirtying
the new record as soon as you open the form. Is this what you mean by write
mode? That the new record is dirtied, and so the user must complete the
entry or undo it before proceeding to another new or old record?

If you don't want it to do that, it would make sense to remove the code from
the Load event.

If you want to have the code anyway, yet let the user out sometimes, they
just have to press the <Esc> key twice to undo the record.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Sam" <ar************@pearson.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...
Allen,
Yes I was aware of that. And I used both as I want the form to open
ready to add a new record but still be able to step back to through
previous records. I should have explained this better the first time
as there's more than just this code in the load event - see code below

strQuery = "SELECT * FROM [Get_CSR_Profile]"

Set qdfDef = CurrentDb().CreateQueryDef("", strQuery)
Set rsRecordset = qdfDef.OpenRecordset(dbOpenDynaset)

strContReason = rsRecordset!CONTINGENCY_REASON
strSiteID = rsRecordset!SITE_ID
strLocation = rsRecordset!LOCATION
strCSR_Type = rsRecordset!CSR_TYPE
If rsRecordset.RecordCount <> 0 Then
'Me.CONT_REASON.Value = sRecordset!CONTINGENCY_REASON
Me.SITE_ID_Combo.Value = rsRecordset!SITE_ID
'Me.CUSTOM_LOCATION.Value = rsRecordset!LOCATION
'Me.CSR_TYPE_Combo.Value = sRecordset!CSR_TYPE
End If

The code above populates some fields on the form so the user doesn't
have to re-enter it every time they open thier DB (they all have their
own copy of the DB). Becuase I'm populateing these fields the form
goes into write mode right away. The user is then not allowed to
scroll back through previous records because there are other fields on
the form that are required. My question is, is there anyway around
this? Is there a way to take the form off write mode? Or any other
way?

Thanks and sorry for the confusion.

May 24 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: MX1 | last post by:
This is weird. I'm trying to make a subform on a form and have it show the entries from one of my tables. The odd thing is that when I look at the table itself, I can see a "+" sign next to each...
28
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during...
6
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new...
2
by: David | last post by:
Hi, I have an order form which has a field 'ProductID'. This form has a button on each record to open a new form linked by ProductID. This new form is a continuous form and obviously, only...
1
by: KC | last post by:
Hello, I am using Access 2002. WinXP, Template from MS called Orders Mgmt DB. I have tweaked this DB to work for our small co. It has worked pretty well up until I made the mistake of deleting...
1
by: Ardith via AccessMonster.com | last post by:
Hi, I am running Access 2000. I have an application with a web-based front end which accesses an Access back end using ASP (not .Net). It is being used by two groups of people - identical...
4
by: oduamy | last post by:
Before I ask my question - I have to say THANKS for all of the wonderful information and help this forum has provided me!!! You are all invaluable. Also, I posted this on the Microsoft forum as well...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
1
MGrowneyARSI
by: MGrowneyARSI | last post by:
I have a form with 4 tabs/pages and 5 sub forms two of the sub forms are linked to each other useing the querys but they are not linked to any other form, however both of the subforms have lookups on...
4
by: Ironr4ge | last post by:
Hi everyone, I am trying to open the form "Languages" with a diffrent record source to the "Contacts" form where I conducted the search or filter... . I was wondering whether there was a vba...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.