Idea About Some Code

Oct 28, 2005

Hi,

If you look in the database below posted ...there is a table that keeps a track that logs the user that logged in and logged out.

What I want to do is based on the last userID logged in show reports for that specific users.

LogID UserID LoggedIn LoggedOut
17510/28/2005 11:33:21 AM


Can someone help we write the code that can do this?

Thanks,

View Replies


ADVERTISEMENT

No Idea How To Do This

Apr 13, 2008

Is it possible to run a query when a check box is pressed? If it is possible how would i then go about comparing the result. I would like it so that a count query is run when the check box is pressed and then if the result is 20 or greater then a command button is disabled. Any help?

View 2 Replies View Related

A Really Cool Idea....If It Is Possible

Jun 12, 2006

Hey everyone,

I have a crazy idea that I think would be very cool if I got it working, but have no idea where to start. I have a database that is broken down into a front end and a back end, and there are about 10 users who use it off and on throughout the day. This database has an entry form to enter new records. I am wanting to put a text box or a label on that main form that would turn green if the database was in use by another user, besides the one that was currently looking at the form. It would be red if there are no other users accessing the database. Is this even possible? Any suggestions or input would be greatly appreciated.

Thanks,
Chris

View 14 Replies View Related

An Error I Have No Idea How To Fix....

Jul 27, 2006

Yesterday I redesigned some of the forms in our database and all was working fine. It works fine on every pc in the office except 1.

On his pc he gets the following error when opening the database:

"An error occurred while loading form_ContractChargessub. Do you wish to continue?"

If you choose yes the database will open but it doesn't work. I have no idea how to even begin to solve this problem.

I did notice that he was running Access 2003 and everyone else is on 2002. Could this be the problem?

Thanks for any help you can give.

Dianne

View 5 Replies View Related

Form Idea

Jul 19, 2005

Hi . I need to have a single form , or nested subforms for data entry. The proble is the main form requires information from 2 other forms, and these forms in turn require information from other primary key fields. I know its basic form design, but i just cant seem to get my head around it. Any ideas?


tblVehicles
VehicleID Autonumber PK
MakeID FK to tblMakes
ModelYear Number
'any other fields that describe ONLY the vehicle

tblMakes
MakeID Autonumber PK
MakeName Text

tblTires
TireID Autonumber PK
MakeID FK to tblMake
TypeID FK to tblTypes
DatePurchased

tblTypes
TypeID Autonumber PK
TypeName Text

tblTireLocation
TireLocID Autonumber PK
TireLocAbbr Text
TireLocation Text (Front Passenger Side, Front Driver Side, etc.)

tblVehicleTires
VehicleTireID Autonumber PK
VehicleID FK to tblVehicles
TireID FK to tblTires
TireLocationID FK to tblTireLocations
DateAdded Date/Time (Short Date)
DateRemoved Date/Removed (Short Date)

tblVehicleChecks
VehicleCheckID Autonumber PK
VehicleID FK to tblVehicles
CheckDate Date/Time (Short Date)
Mileage Number

tblTireChecks
TireCheckID Autonumber PK
VehicleCheckID FK to tblVehicleChecks
VehicleTireID FK to tblVehicleTires
TireMM Number
TirePressure Number

View 4 Replies View Related

Help With Thoughts/idea's On Doing This

Oct 14, 2004

Looking for some advise and help. I think an array will be recommended and if so, please help with code on how to do this.

I am trying to track prescription (Rx) dates (RxOutDate) going out to medical professionals on a particular order. There can be mulitple Rx going out so there will be multiple dates of when those Rx went out. What I would like to do is have the earlies date posted. ie one Rx went out on 10/13/04 and another goes out on 10/14/04. I would like for the 10/13/04 date to show. I'm using a continuous form to display all Rx's per order, on frmRx. I'm trying to display the date out on the form containing the order (frmOrder).

Any thoughts would be greatly appreciated. If an array is suggested. Please help with code on how to it. I've never written one so I would definitely be in the dark.

Thanks ahead of time,
Shane

View 1 Replies View Related

New Idea Duplicate Surname And DOB

Jul 5, 2005

hi ,

see below for the current code to find a duplicate surname (this works Fine)


now that ive properly thought it through what i need to do is insert a surename and if (by Chance) when i insert the Date of Birth if this is the same highlight it as a duplicate record. However if these people are twins then i need the option to insert the duplicate record.

any ideas on how to go about this, see code below.

Private Sub Text24_BeforeUpdate(Cancel As Integer)

Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset

Set rsc = Me.RecordsetClone

SID = Me.Surename.Value
stLinkCriteria = "[Surename]=" & "'" & SID & "'"

'Check StudentDetails table for duplicate StudentNumber
If DCount("Surename", "tblData", stLinkCriteria) > 0 Then
'Undo duplicate entry
Me.Undo
'Message box warning of duplication
MsgBox "Duplicate Name " _
& SID & " has already been entered." _
& vbCr & vbCr & "You will now been taken to the record.", vbInformation _
, "Duplicate Information"
'Go to record of original Student Number
rsc.FindFirst stLinkCriteria
Me.Bookmark = rsc.Bookmark
End If

Set rsc = Nothing
End Sub

View 1 Replies View Related

Data Organization -- Bad Idea?

Sep 19, 2005

My primary key for my database a WorkOrder Number. The issue is that sometimes problems span a selection of WorkOrders. For example, if we get a lot of bad parts, 3 different WorkOrders might be affected, and each may have different resolution to the effect.
To speed up data entry, I've had a request to make a button that copies the all the information from a current record into a new one.

If much of this information repeats, it this a poor way to handle this data?
Currently it is pretty straight forward with ostly one->many relationships, and this would make things pretty complicated with a bunch of many<->many relationships.

Just want to know ya'll opinions.

View 2 Replies View Related

Help Implementing A Neat Idea

Jan 13, 2006

I’m working to ever-improve a Help Desk-like database and I got this idea for “templates.” That is, a quick way to fill out the as much of the ticket form as possible when common issues come in.

So I’ve created a table (Templates)that mimics the structure of my ticket table (Incidents). I’ve gone into Templates and put the values I want automatically entered in each field and I’ve added a combo box and a button on my ticket screen. The combo box is populated, from Templates, with the name of each Template.

My problem is that I have no idea how to make each field on the Incident form populate with the values from the Template table.

Any help would be greatly appreciated!

View 7 Replies View Related

Table Structure Idea Help

Aug 4, 2005

I need help with table structure, They keep way too much info. Now that I have said that here is what I need help with. I have been asked to make a small "Ha ha" Database this is what small became. Most of the data for this is in a spreadsheet now I know I can import it where I want it. The main concerbn is that the main piece of information would be the Job Address. Because of all this other information I was not really sure how to setup the tables here is what I have started .

Buyers Information (tbl)
Fname
Lname
Address City State Zip (with a look to qry)"cool zipcode code"
Phones (3)
Email
Ect.

Buyers Realtor Info (tbl)
Fname
Lname
Company Name
Address City State Zip (with a look to qry)"cool zipcode code"
Phones (3)
Email
Ect.

Sellers Information (tbl)
Fname
Lname
Address City State Zip (with a look to qry)"cool zipcode code"
Phones (3)
Email
Ect.

Buyers Realtor Info (tbl)
Fname
Lname
Company Name
Address City State Zip (with a look to qry)"cool zipcode code"
Phones (3)
Email
Ect.

Job Information (tbl)
Address
City (Filled in by Zip)
State (Filled in by Zip)
County (Filled in by Zip)
Zip (with a look to qry)"cool zipcode code"
RoofType (With a lookup to A list tbl)
RoofCondition (With a lookup to A list tbl)
Job Notes (memo)

Appointment Information
Time (now real sure how these time and date will work)
Date ( " )
Appointment Type (With a lookup to A list tbl)
Contact Name
Salesman (With a lookup to Salesmen Table)
Appointment Results (memo)
Referral

As I mentioned this data is in a spreadsheet and most every row has all of the above information ("ha ha, small") but I wanted to get some other Ideas and see if anybody had a better one before I tryed to make it all work.

Thanks

View 6 Replies View Related

Still Working On My Template Idea

Feb 28, 2006

I may be oversimplifying my idea here, but I'm trying to have Form A, which has a source of Table A have fields automatically filled out with values from Table B when I select a template name and click a button that's on Form A. I simply have no idea how to make something this simple happen. Any ideas?

View 7 Replies View Related

My Stupid Loop Idea

Jul 6, 2006

I've got 20 checkboxes which i need to do the same thing but individually.

If IsNull(DLookup("[question 1]", "qryQuestions")) Then
chkQuestion1.Visible = False
Else
chkQuestion1.Visible = True
End If


I tried this:

Dim loopy As Integer
Dim tmpquest As String

For loopy = 1 To 20
tmpquest = "question " & loopy
tmpCheck = "chkQuestion" & loopy
If IsNull(DLookup(tmpquest, "qryQuestions")) Then
tmpCheck.Visible = False
Else
tmpCheck.Visible = True
End If
Next loopy

tmpquest works.
tmpcheck doesn't.

I tried dimming tmpcheck as lots of things but no luck.

Any help?

View 6 Replies View Related

Request Form, No Idea How To Set Up

Jan 17, 2005

I am thinking of adding a Request form to my database so that if the user wants to add a code to the system, they could fill out the form click send and i would then be able to retrieve all the requests via a report.

I have designed the form to something like what i am after...

i have a few issue's here:

A)

i have set up an option wizard so that user can select if this is a new code or a failure mode request

if the user selects "New Event Code" i want the the text box and label for Eventcode Description to become visible and all others to become inactive.

i will explain what happens if the user chooses "Failure Modes" in a minute.

B) I have no idea what is the best method to sort the following section, if you look at my form at the bottom (Highlighted in red) i need this to be a continuous option as the user may wish to add more than one Failure mode to an Event Code.

C) going back to my options if the user select "Failure Modes" i need the bottom section to become active.

D) If that was not bad enough i have no idea on how to store this in a table.


Definitions:

Event Code ---> Top Line Code

Failure Mode --> Is the Event code description but broken down further

Any Advice or help would be much appreciated

All the best

Andy

View 1 Replies View Related

Good VBA Book, Any Idea?

May 9, 2007

I really need to learn how to code in VBA for access. Can someone direct me to a good VBA Book?

View 1 Replies View Related

Opinion On Design Idea/possibility

Aug 23, 2007

Hello Everyone

I am looking to build and Overtime tracking form and have been pondering on the design of it. Here is my idea and not sure how I should go about doing it (straight forms and tables or queries). I would like to select my employees in a combobox and have their information autofill the remaining fields and/or add new ones. Additionally have fields that I can input any overtime occurred which would be stored in a seperate table but displayed in a sub-form in datasheet view. These fields that were just filled out with the overtime information would clear everytime the add record button is hit.

I know that sounds like alot and sure I can muddle my way through that part of it, the big question I have is do I need a seperate table for every employees overtime? Or is there code/query that can select the records of the selected employee and display the information that pertains just to them?

Has anyone come across or posess a sample database similar to this? If not can someone point me in the right direction for example code and tutorials?

I look forward to hearing from everyone on this.

Thank You

Jaz

View 2 Replies View Related

Baxter....table/form Idea...

Aug 18, 2004

Bax, I am still dealing with that problem of getting my statistics form to show. Is it possible for me to set it up so that when a new player is added into the player information table that the statistic table will populate itself with the [Uniform #], [FirstName] & [LastName] and default 0's to all statistical fields?

Just a thought....

View 1 Replies View Related

Is Access A Good Idea For My Project?

Feb 13, 2007

Hi! I have a client who wants a training tracking software built that will allow for simultaneous use by up to 850 users. Is Access a good idea, or should I use SQL, and if yes to SQL, can you point me to some great documentation supporting this? Thank you, thank you, thank you!

KellyJo

View 3 Replies View Related

Good Or Bad Idea? Text Box In Main Table Or Other?

Dec 1, 2004

I would like to add a textbox to my main form so that users can enter in some extra data regarding the job they are working on. This text box should tie to the current record of the main database, tableJobLog.

Is it best to keep this textbox as a field in the main database, tableJobLog? Or should I create a separate table (perhaps tableJobNotes) with just this text field and link the two tables?

I would think that having it in the main table would make the table grow considerably in size after some time.

If creating a separate table is better, I would need some guidance on how to do this.

Thank you very much.

View 2 Replies View Related

Please Review This Code, (simple Code) New With Codes

Feb 16, 2006

Works great, but when I hit the number "3", (3 times in row) it will let me into the form. I want it to not let me in IF I don't know the password.

Where did I go wrong?

Private Sub Form_Load()
Dim pw As Variant

If InputBox("What is the password?", "Password") = "1" Then
Else
MsgBox "Invalid Password", vbCritical, "Sorry Charlie"
DoCmd.Close
If InputBox("What is the password?", "Password") = "2" Then
Else
MsgBox "Invalid Password", vbCritical, "Sorry Charlie"
DoCmd.Close
End If
End If


End Sub

View 14 Replies View Related

Using Code To Unprotect And Protect Viewing Code

Jan 14, 2007

I protect my code from people being able to read it by setting a password on the code from Tools > Properties, selecting the Protection tab and entering a password, and clicking "Lock Project"

Is there a way to write code that will remove that Lock Project check and check it back on?

I've looked through the Application.SetOption command and it doesn't seem to be one of the choices. It would be very helpful if someone knew how to do this.

Thanks

SHADOW

View 6 Replies View Related

Code Help Please!

Apr 27, 2005

I have a button that runs a macro to insert NOW() into a text box.
This is how it is coded;

Private Sub Start_transferred_job_button_Click()
On Error GoTo Err_Start_transferred_job_button_Click

Dim stDocName As String

stDocName = "Start transfered job"
DoCmd.RunMacro stDocName

Exit_Start_transferred_job_button_Click:
Exit Sub

Err_Start_transferred_job_button_Click:
MsgBox Err.Description
Resume Exit_Start_transferred_job_button_Click

End Sub


How do I write the code to populate the [start Time] text box with NOW() when the button is clicked without using a macro???

View 1 Replies View Related

Need Help With Code

Nov 22, 2005

Need a little help here. I have this code on a command button that open a form that displays a chart. The chart work great as long as there is data to display. However, if there is no data then the chart is blank. So what I'm trying to do is add a dcount to catch the 0 and give an error. So the 1st query makes the table where the data for the chart come from. The Qry-Test for Zero query, queries that new table if dcount is 0 it should error.
My problem is that I can't get this to work with the 0 if I make it 1 then I will get the message box if there are no records and if there is 1 record 2 and greater work fine. So my question is why won't the code catch the 0?


Dim stDocName As String
stDocName = "Qry-Makes Table"
DoCmd.OpenQuery stDocName, acNormal ', acEdit

If DCount(" * ", "Qry-Test for Zero") = 0 Then
MsgBox " There is no data for this time frame to chart. Please re-enter your Date range"
Exit Sub
Else



Thanks

jon

View 1 Replies View Related

Need Help With Code

Nov 22, 2005

Need a little help here. I have this code on a command button that open a form that displays a chart. The chart work great as long as there is data to display. However, if there is no data then the chart is blank. So what I'm trying to do is add a dcount to catch the 0 and give an error. So the 1st query makes the table where the data for the chart come from. The Qry-Test for Zero query, queries that new table if dcount is 0 it should error.
My problem is that I can't get this to work with the 0 if I make it 1 then I will get the message box if there are no records and if there is 1 record 2 and greater work fine. So my question is why won't the code catch the 0?


Dim stDocName As String
stDocName = "Qry-Makes Table"
DoCmd.OpenQuery stDocName, acNormal ', acEdit

If DCount(" * ", "Qry-Test for Zero") = 0 Then
MsgBox " There is no data for this time frame to chart. Please re-enter your Date range"
Exit Sub
Else



Thanks

jon

View 1 Replies View Related

Code Help?

May 19, 2006

I use the code below on a search form. I would like for the results of the list box search to populate a report instead of the list box. Is it possible to take the the sql and move it to a report? Thanks..

Dim strsql As String, strOrder As String, strWhere As String
Dim dbNm As Database
Dim qryDef As QueryDef
Set dbNm = CurrentDb()

strsql = "SELECT SiteIssues_tbl.IssueID, SiteIssues_tbl.SITE_ID, SiteIssues_tbl.IssueID, SiteIssues_tbl.AdminDate, SiteIssues_tbl.Occurring, SiteIssues_tbl.Issue, SiteIssues_tbl.Administrative, SiteIssues_tbl.Technical, SiteIssues_tbl.IssueComments, SiteIssues_tbl.CandidatesAffected, SiteIssues_tbl.RecordCreated, SiteIssues_tbl.User, SiteIssues_tbl.DateModified " & _
"FROM SiteIssues_tbl"


strWhere = "WHERE"

strOrder = "ORDER BY SiteIssues_tbl.AdminDate;"


'Set the WHERE clause for the QueryDef if information has been entered into a field on the form
If Not IsNull(Me.txtIssue) Then '<--If the textbox txtCenterName contains no data THEN do nothing
strWhere = strWhere & " (SiteIssues_tbl.Issue) Like '*" & Me.txtIssue & "*' AND" '<--otherwise, apply the LIKE statment to the QueryDef
End If

If Not IsNull(Me.txtAdminDate) Then
strWhere = strWhere & " (SiteIssues_tbl.AdminDate) Like '*" & Me.txtAdminDate & "*' AND"
End If

If Not IsNull(Me.txtSite) Then
strWhere = strWhere & " (SiteIssues_tbl.SITE_ID) Like '*" & Me.txtSite & "*' AND"
End If

'Pass the SQL to the RowSource of the listbox

Me.lstSearchResult.RowSource = strsql & " " & strWhere & "" & strOrder

With Me.lstSearchResult
If .ListCount > 0 Then
GetListCount = .ListCount - 1 'Headings count
Else
GetListCount = 0 'Headings don't count if no items listed!!
End If
Me.Text31 = .ListCount - 1

Dim ctl As Control
End With
If Me.Text31 = -1 Then
Me.Text31.Value = 0
Me.lstSearchResult.RowSource = ""
DoCmd.RepaintObject acForm, "SitesIssues_qry"
Me.Requery


MsgBox "No Records Found."

For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acCheckBox Then
ctl.Value = Null
DoCmd.RepaintObject acForm, "SitesIssues_qry"
Me.lstSearchResult.RowSource = ""
Me.Requery
End If
Next ctl
End If

View 1 Replies View Related

VBA Code

Jun 1, 2006

I have written the code below, which should work, however I am receiving an Error: Run Time Error '13' Type mistmatch on line:

Set cn = Application.CurrentProject.Connection.

Can anyone help?

Option Compare Database
Option Explicit

Private Sub cmdRun_Click()

Dim NICode As String
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection

Dim strSQL As String

Set cn = Application.CurrentProject.Connection
Set rs = New ADODB.Recordset
NICode = "txtLetter"

strSQL = "SELECT " & NICode & "1a, " & NICode & "1b, " & NICode & "1c, " & NICode & "1d & NICode & "1g & NICode & "1h FROM [WorkPlace NI Breakdown]"

rs.Open strSQL, cn

If Not (rs.EOF And rs.BOF) Then
MsgBox rs.Fields(NICode & "1a")
MsgBox rs.Fields(NICode & "1b")
MsgBox rs.Fields(NICode & "1c")
MsgBox rs.Fields(NICode & "1d")
MsgBox rs.Fields(NICode & "1g")
MsgBox rs.Fields(NICode & "1h")


End If
rs.Close
cn.Close

Set rs = Nothing
Set cn = Nothing

End Sub

View 3 Replies View Related

A Code

Jan 3, 2007

Hi all,

I have code bellow which is bringing a tab called Heffalump from the excel spreadsheet into table. Now, what I need is to create a text box where I will be typing PI1228131313 and it's going to be changed in the code bellow.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Test Import Specification", "K:FIDCPGCCGPI1228", True, "Heffalump!"

THANKS,
B

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved