Hello,
I am building an Access Database that uses one table and two forms.
One user puts part of the information into one form as a request to be completed and another user opens their version of a form that allows them to "complete" the request by putting in their information.
I have split the database and sent all users the front end while I maintained the back end within a shared file. all updates are working just fine.
The issue that I am having is that when the second user opens the second form, the form always opens to the first record. What I want it to do is open to the first record that has a null in a specific field (the next request that I want them to process). If anyone can help me figure this out, it would be really appreciated.
I am confused.
The code you posted is on the OnOpen of the form, but you are referring to the OnLoad.
The Filter needs to be applied on the OnOpen Event
So:- - Private Sub Form_Open(Cancel As Integer)
-
-
Me.Filter = "[Work Completed By] is Null AND [Date Completed] is Null AND [Work Comments] is Null"
-
Me.FilterOn = True
-
-
End Sub
This assumes you have Controls NAMED EXACTLY "Work Completed By", "Date Completed" and "Work Comments".
This should show the form only when all 3 controls are blank. Change the "AND"s to "OR"s to show the form if any one control is Null.
I Don't like the name of your Form with a minus sign in the middle. Use an underscore if you must, but what's the matter with "RequestMSA"?
Phil
13 1198
Both forms should have an identical underlying recordsource (particularly the sort order), but in the RecordSource for form 2, you need to set the criteria that your specific field IsNull.
Phil
I am pretty new to Access, so please go easy.
The record source is the same for both forms. The first form puts in 8 fields and the second reads those fields and puts in 3 more. I want the second form to open to the next record that does not already have those 3 fields filled in. That was the Null part I was talking about.
I'll be as gentle as I can.
Are you using a Query as the RecordSource, if so, do you know how to use the Query Design to create the query?
Phil
No need for a query for the record source for the second form. Just set the Filter to [FieldName] Is Null . Just make sure the FilterOn property is set to “Yes”.
Hope this hepps!
Twinnyfo is correct, but you need to consider exactly what you mean by three fields being Null. Do you mean all 3 fields being Null, or any one of the 3 fields being Null.
I rather suspect the latter option.
If so the filter will look like -
Private Sub Form_Open(Cancel As Integer
-
Me.Filter = "[FieldName1] Is Null Or [FieldName2] Is Null Or [FieldName3] Is Null"
-
Me.FilterOn = True
-
End Sub
Phil
Yes, all three fields would be Null in my ideal world to be honest.
Now comes the go easy on me part. How would I take that line of code and make the form to the work? The name of the Form is: "Request - MSA" and the fields that read Null are: "Work Completed By", "Date Completed" and "Work Comments".
OK, so I went to Load event for the form and added a Code event: I tried to put in the code as follows: - Private Sub Form_Open(Cancel As Integer)
-
Me.Filter = "[Work Completed By] Is Null"
-
Me.FilterOn = True
-
End Sub
and it gave me an error: the expression On Load you entered as the event property setting produced the following error: Expected: Line number or label or statement or end of statement.
I am so lost right now.
You must have something in your OnLoad Event that is causing that error.
I am confused.
The code you posted is on the OnOpen of the form, but you are referring to the OnLoad.
The Filter needs to be applied on the OnOpen Event
So:- - Private Sub Form_Open(Cancel As Integer)
-
-
Me.Filter = "[Work Completed By] is Null AND [Date Completed] is Null AND [Work Comments] is Null"
-
Me.FilterOn = True
-
-
End Sub
This assumes you have Controls NAMED EXACTLY "Work Completed By", "Date Completed" and "Work Comments".
This should show the form only when all 3 controls are blank. Change the "AND"s to "OR"s to show the form if any one control is Null.
I Don't like the name of your Form with a minus sign in the middle. Use an underscore if you must, but what's the matter with "RequestMSA"?
Phil
Looks like you copied the line numbers, you have to get rid of those
That worked PERFECTLY!!!!! Thank you so much for the help.
@twinnyfo
I suspect as Rabbit pointed out post No 9 did have line nos in the code. I think your edit of the post may have removed them. @DocBlack4444
Please when you post code or SQL copy it from your Db, then use the [CODE/] that you see at the top of the box, and PASTE your VBA between the "CODE" and "/CODE".
Then we know exactly what you have.
Similarly, if someone provides you with code, Copy it from the Bytes Website and paste it into your module.
Phil
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Josh Strickland |
last post by:
I am attempting to create an Access database which uses forms to enter
data. The issue I am having is returning the query results from the
Stored Procedure back in to the Access Form.
...
|
by: Seth Spearman |
last post by:
Hey guys,
I have the following code:
'******************************************************
If Not Me.NewRecord Then
Dim rs As DAO.Recordset
Dim strBookmark As String
Set rs =...
|
by: Karl Roes |
last post by:
Hi All,
I would like some advice on Next / Previous record buttons.
I have a main form for the client, and a continuous subform listing
client transactions. If I open one of these transactions...
|
by: Leah Trahan |
last post by:
I am new at Access, databases, AND posting threads (sorry). I have a subform that is a continuous form based on a tabular query. I enter a particular serial # (on the main form) and the subform...
|
by: getro |
last post by:
Hi Everyone,
I need to open an Access 2003 form to a specific record from a custom Outlook 2003 Appointment form. The form has a command button that would pass a record id to access and open the...
|
by: kpresidente |
last post by:
Hello all,
I'm trying to transfer the value of a control on an Access form to an Excel worksheet using VBA. The Access form is a single form with all the controls disabled, so that data is "read...
|
by: munkee |
last post by:
Is there a way to automatically have a web based data access page to start on a new record when you open the page? (Without going to data entry mode in page properties) If I go to data entry mode,...
|
by: Will M |
last post by:
I saw this question elsewhere on this site, but it was five years old, so I'm asking anew . . .
I want to open a form in Access 2007 (on WinXP) by clicking a button on a different form, and I want...
|
by: RockKandee |
last post by:
I am using the MS Calendar found on this site with Access 2013 on Windows 8.
http://bytes.com/topic/access/answers/761255-ms-access-calendar
I am working on adding a form that opens from a day...
|
by: ESAKKI109 |
last post by:
In Microsoft access 2013 how can I set last record as a default without VBA coding and macro when form opens?
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |