473,395 Members | 1,823 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.

MS Access Form Format Question

I have 2 forms that I am using for inputing data. The first form
('Client') has various info based on a 4 digit client number (name,
address, ect).

The second form ('group') has a group name and the option to add up to
10 of the aofrementioned account numbers that have something in common
(similiar mailing addresses for instance).

What I am trying to do is get a box in the 'Client' form to
automatically show the group name entered in the 'Group' form IF the
account number is one of the 10 account numbers in the 'Group' form.

Any ideas. Please be as specific as you can. Thank you in advance for
any help!

Michael Burkett
Nov 12 '05 #1
4 4034
Can a client be assigned to more than 1 group?

Phil
"Michael Burkett" <mi*****@ccminc.com> wrote in message
news:28**************************@posting.google.c om...
I have 2 forms that I am using for inputing data. The first form
('Client') has various info based on a 4 digit client number (name,
address, ect).

The second form ('group') has a group name and the option to add up to
10 of the aofrementioned account numbers that have something in common
(similiar mailing addresses for instance).

What I am trying to do is get a box in the 'Client' form to
automatically show the group name entered in the 'Group' form IF the
account number is one of the 10 account numbers in the 'Group' form.

Any ideas. Please be as specific as you can. Thank you in advance for
any help!

Michael Burkett

Nov 12 '05 #2
"Phil Stanton" <ph**@stantonfamily.co.uk> wrote in message news:<3f*********************@mercury.nildram.net> ...
Can a client be assigned to more than 1 group?

Phil
"Michael Burkett" <mi*****@ccminc.com> wrote in message
news:28**************************@posting.google.c om...
I have 2 forms that I am using for inputing data. The first form
('Client') has various info based on a 4 digit client number (name,
address, ect).

The second form ('group') has a group name and the option to add up to
10 of the aofrementioned account numbers that have something in common
(similiar mailing addresses for instance).

What I am trying to do is get a box in the 'Client' form to
automatically show the group name entered in the 'Group' form IF the
account number is one of the 10 account numbers in the 'Group' form.

Any ideas. Please be as specific as you can. Thank you in advance for
any help!

Michael Burkett


No. Any given client will only be in 1 group. Thanks
Nov 12 '05 #3
OK Michael Piece of cake

I presume the GroupsTable contains
GroupID Autonumber
Group Text Required = true

In the ClientsTable you need
ClientID Autonumber
ClientRef Number Long Integer Indexed Yes Duplicates
allowed no ' That is your reference no
Client Name Text
ClientAdd1 Text
etc
GroupID Number Long Integer

Set up a relationship between the ClientsTable and GroupsTable joining the
GroupID in the GroupsTable with the GroupID in the ClientsTable and enforce
referential ingegrity

You then need your client form based on the ClientsTable (or query because
you may want to sort it by Clientname)
Have a Combo box called GroupID
ControlSource is GroupID
RowSourceType is Table/Query
RowSource "SELECT Group, GroupID
FROM Groups ORDER BY Group"
ColunmCount 2
ColumnWidth 2cm,0cm
BoundColumn 2

This will show the correct group for each client

You then need some visual basic to check the number of clients in this group
before you update it
Click on the GroupID Combo Box
In the properties box choose the events tab and under the Before Update type
[E square bracket
It should change this to [Event Procedure]
At the right of that line there are 3 dots which opens the VB box

Type

Option Compare Database
Option Explicit

Private Sub GroupID_BeforeUpdate(Cancel As Integer)

Dim MyDB As Database
Dim CountSet As Recordset
Dim SQLStg As String

SQLStg = "SELECT Count(ClientID) AS CountOfClientID "
SQLStg = SQLStg & "FROM Clients "
SQLStg = SQLStg & "WHERE GroupD = " & GroupID & ";"

Set MyDB = CurrentDb
Set CountSet = MyDB.OpenRecordset(SQLStg)
If CountSet!CountOfClientID > 10 Then
MsgBox "You have " & CountSet!CountOfClientID & " Clients in this
group", vbCritical
Cancel = True
End If
CountSet.Close
Set CountSet = Nothing

End Sub

Some of the above will already be there, so make sure it only occurs once

Have fun

Phil

No. Any given client will only be in 1 group. Thanks

Nov 12 '05 #4
"Phil Stanton" <ph**@stantonfamily.co.uk> wrote in message news:<3f*********************@mercury.nildram.net> ...
OK Michael Piece of cake

I presume the GroupsTable contains
GroupID Autonumber
Group Text Required = true

In the ClientsTable you need
ClientID Autonumber
ClientRef Number Long Integer Indexed Yes Duplicates
allowed no ' That is your reference no
Client Name Text
ClientAdd1 Text
etc
GroupID Number Long Integer

Set up a relationship between the ClientsTable and GroupsTable joining the
GroupID in the GroupsTable with the GroupID in the ClientsTable and enforce
referential ingegrity

You then need your client form based on the ClientsTable (or query because
you may want to sort it by Clientname)
Have a Combo box called GroupID
ControlSource is GroupID
RowSourceType is Table/Query
RowSource "SELECT Group, GroupID
FROM Groups ORDER BY Group"
ColunmCount 2
ColumnWidth 2cm,0cm
BoundColumn 2

This will show the correct group for each client

You then need some visual basic to check the number of clients in this group
before you update it
Click on the GroupID Combo Box
In the properties box choose the events tab and under the Before Update type
[E square bracket
It should change this to [Event Procedure]
At the right of that line there are 3 dots which opens the VB box

Type

Option Compare Database
Option Explicit

Private Sub GroupID_BeforeUpdate(Cancel As Integer)

Dim MyDB As Database
Dim CountSet As Recordset
Dim SQLStg As String

SQLStg = "SELECT Count(ClientID) AS CountOfClientID "
SQLStg = SQLStg & "FROM Clients "
SQLStg = SQLStg & "WHERE GroupD = " & GroupID & ";"

Set MyDB = CurrentDb
Set CountSet = MyDB.OpenRecordset(SQLStg)
If CountSet!CountOfClientID > 10 Then
MsgBox "You have " & CountSet!CountOfClientID & " Clients in this
group", vbCritical
Cancel = True
End If
CountSet.Close
Set CountSet = Nothing

End Sub

Some of the above will already be there, so make sure it only occurs once

Have fun

Phil

No. Any given client will only be in 1 group. Thanks


THANK YOU!
Nov 12 '05 #5

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

Similar topics

1
by: Joris Kempen | last post by:
Hi people, I know that the question has come around sometimes: How to open an Access Report using ASP and export it to for example RTF. I'm trying to implement the first method of David...
3
by: Megan | last post by:
I am not that good at Access and don't know much about it, so I have a few questions for anyone who knows Access very well. First off, I should mention that the company I work for uses Access as a...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
3
by: krygsma | last post by:
So, I need to figure out how to do what I want to do with Access. I have many questions with mutually exclusive options, each option has a value, never=0, few times=1...ect.. (then when questions...
8
by: Jerry | last post by:
I have an off-the-shelf app that uses an Access database as its backend. One of the tables contains a field with an "OLE Object" datatype. I'm writing some reports against this database, and I...
5
by: Bec | last post by:
I'm in desperate need of your help.. I need to build an access database and have NO idea how to do this.. Not even where to start.. It IS for school, and am not asking anyone to do my...
9
by: Bob Alston | last post by:
I am looking for electronic forms software that would integrate well with MS Access. I have a client for whom I built a client database to replace and update one they had that was obsolete and...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...
0
jinu1996
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...
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.