Code Help Needed On Message Box Please

Apr 30, 2007

Hi All, Is it possible to have just one instance of this message box fire when one or all or any number of the flags are triggered. At the moment if 2 flags are set then 2 messgage boxes appear,if 3 then 3 messages etc. My code at the moment is below to trigger the message box, hope I make my self clear;can it be tidied up?





private Sub Form_Current()
If Me.Flag1 = "Patient Alert. HIGH RISK. Med Hist" Then
MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment"
End If
If Me.Flag2 = "Patient Alert. ALLERGY. Med Cond" Then
MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment"
End If
If Me.Flag3 = "Patient Alert. Cat Score. LOW. Caution See Notes" Then
MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment"
End If
If Me.Flag4 = "Patient Alert. PATHOLOGY. Int/Ext Exam" Then
MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment"
End If
End Sub

View Replies


ADVERTISEMENT

Help On Message Box Code Needed

May 9, 2007

Hi All,:confused: need some code help again, I dont seem to be able to get the hang of message boxes!! The code below takes the path to a mdb file which is stored in a text box on my form, it then deletes an existing table -Expire-and replaces it with a new table also called Expire from the database located at the file path in the text box.

Private Sub Command6_Click()
Dim tmpFilePath As String
tmpFilePath = Me!Text1

DoCmd.DeleteObject acTable, "Expire"
DoCmd.TransferDatabase acImport, "Microsoft Access", tmpFilePath, acTable, "Expire", "Expire", False
DoCmd.Close

End Sub


What I would like to happen is; when the process has finished a message box pops up and informs the user that:

"the update has been successfull, your DentureBase V2 licence key has been updated"

the form then closes. If it is at all possible I would then like the db to close and restart (but this is not essential).

Once again I appeal to your generousity, many thanks:D

View 3 Replies View Related

Nearly There Just One Line Of Code Needed...

Mar 12, 2008

Hi All

I have the following code and wish to change the Weights.Collected field to True from false in the new query (expr3: ) in the new query.

Thanks



Private Sub cmdBuildQuery_Click()
On Error GoTo Err_BuildQry
Dim strSQL As String
Dim qdf As DAO.querydef
strSQL = "SELECT TOP "
strSQL = strSQL & Me.txtNumberToGet
strSQL = strSQL & " weights.Weights, Weights.DocketNo, Weights.Collected, Weights.UKBulk, Weights.weighttime FROM CollectionQry "
strSQL = strSQL & "ORDER BY ([id]);"

DoCmd.DeleteObject acQuery, "qryCollectYorks"

CurrentDb.CreateQueryDef "qryCollectYorks", strSQL

DoCmd.OpenQuery "appendUkBulk"
DoCmd.OpenQuery "qryCollectYorks"
Exit_BuildQry:
Exit Sub
Err_BuildQry:
If Err.Number = 7874 Then
Resume Next
Else
MsgBox Err.Number & " - " & Err.Description
Resume Exit_BuildQry
End If
End Sub

View 7 Replies View Related

Desperately Needed Code

Dec 28, 2004

Hi,
I have a database that has a combined user last name, user first name and user middle initial all in one field called name.

Example:

NAME
DOE JOHN I.
SMITH JOHN R.

I would like to get a code that will look at the field and separate them in three different fields, such as :

LNAME
DOE
SMITH

FNAME
JOHN
JOHN

MI
I.
R.


I would really appreciate any help.

Sincerely,
Monti

View 2 Replies View Related

URGENT HELP Needed For VB Code

Feb 10, 2005

Hello all
I am having a problem with my vb code. I am realatively new to vb and what I am trying to do is search through a table according to what is selected on my form and delete the values that equal the value selected int the table. What I have so far is this

Private Sub cmdDel_Click()
Dim rsSource As DAO.Recordset
Dim rsDestination As DAO.Recordset
Dim theBug As String
Dim SelItm As Control
Set SelItm = Me.Users
If Me.Schedule.ItemsSelected.Count = 0 Then
Beep
Exit Sub
End If
Set rsDestination = _
CurrentDb.OpenRecordset("User_Course_Room", _
dbOpenDynaset)

For Each Itm In Me.Schedule.ItemsSelected
rsDestination.FindFirst "User_ID = " & Me.Users & "" And "Course_Room_ID = " & Me.Schedule.ItemData(Itm) & "" ### THIS LINE GIVES ME A ERROR
'rsDestination!Course_Room_ID = Me.Schedule.ItemData(Itm)
'rsDestination.FindFirst "Course_Room_ID = " & Me.Schedule.ItemData(Itm) & ""
rsDestination.Edit
rsDestination.Delete

Next Itm

Me.Sessions.Requery
Me.Schedule.Requery

End Sub

In the line with the bold writing next to it I get an error. What I am trying to do is search for the record with the user id selected and the course room id seleceted and delete that record but I get an error. Any help would be highly appreciated.

View 2 Replies View Related

Code For Message Box

Apr 24, 2006

I am trying to write the code which will show a Message Box if another field in a table is "Not Null" . Here is what I am attempting:

Upon exit of [JobFieldname]
Look at record in [Table].[Jobinfo]. where [JobFieldname] match
If [Yes/Nofieldname] = "Yes" then
Open Message Box "My message Here"


Can someone help me? I havn't found the answer looking through the threads.

View 4 Replies View Related

Error Message In Command Button Code

Jun 29, 2005

I have created command buttons to enter event registration information after biographical information has been completed. When I click on the button I get the following error message:

"Microsoft Office Access cannot find the field '|' referred to in your expression."

This is the On Click code that I have in there. Can anyone spot the error of my ways?

Private Sub RegisterButton_Click()
On Error GoTo Err_RegisterButton_Click
If IsNull(Me![AttendeeID]) Then
MsgBox "Enter attendee information before registering for an event."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Registration", , , "[Registration]![RegistrationID]=Forms![Attendees]![Attendees Subform].form![RegistrationID]"
End If

Exit_RegisterButton_Click:
Exit Sub

Err_RegisterButton_Click:
MsgBox Err.Description
Resume Exit_RegisterButton_Click
End Sub

Thanks!

View 1 Replies View Related

How Do I Code A Message If Two Records Have A Replicated Field?

Jun 12, 2007

How do I code the following?

I have a field in a table called surname. This is not the primary key and I don't want to set it as a unique field however I want there to be a message box that comes up saying "There is already another person of this surname (or something like that" if the surname entered already exists in the database.

Any ideas appreciated

View 2 Replies View Related

Modules & VBA :: How To Set A Message On Screen And Remove From Code

Jun 5, 2014

I would like to put a message on the screen for informing the user - mostly during some procedures that might take time or when, after a warning, I want to go on with the program but without action from the user.

Msgbox is obviously not the one I'm looking for as it needs customer acknowledge. Is there a solution for this task?

View 1 Replies View Related

Modules & VBA :: How To Pause Code When Calling Custom Message Box Form

Feb 9, 2014

I have created a custom message box form that suits my needs for this particular situation. It is called (opened) in the middle of a bunch of other VBA procedures. What I am having a problem with is how do I "pause" the rest of the code from running after the message box call?

For example, with a regular msgbox() function, once called, the code will wait for the user input or click of a button, then continue. My problem is that I am using the basic docmd.openform procedure, and it opens the message box form just fine, but then continues on with the rest of the code after the form is opened.

How would I "pause" the code after the call of opening my custom message box form, then continue it after the user clicks one of my closing buttons from that form?

Furthermore, although its not entirely needed in this situation, for future reference, how would I have that message box form return a value to the calling procedure?

View 14 Replies View Related

Forms :: Create A Message Box To Flash On Screen To Tell User That Update Code Is Running

Mar 6, 2014

I need to create a message box or a form or something to flash on the screen to tell the user that a piece of "Update" code is running. the update code will be updated reports from marketing returns, but the 3 branches who use the information are separate so I am creating an update form to download and update the table.

The code for the update is already working, but can take a while, so I thought a message or splash screen would be useful as the update runs on start up.

It would have another use, I have a report which is made mainly of calculated fields on an onPrint event and also takes a while to work it out, so a similar screen would be more useful than my current spinning circle and blank screen.

View 1 Replies View Related

Access 2007 Who Is Log On "code" Error Message

Dec 17, 2007

Not being a code person. This code worked great for 2003, but we just installed 2007. I get an error message when the this code runs:

Its a complie error
User-defined type not found

Sub ShowUserRosterMultipleUsers()
Dim cn As New ADODB.Connection.....red shows where I get the error message
Dim rs As New ADODB.Recordset
Dim i, j As Long

Set cn = CurrentProject.Connection

' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4.0 OLE DB provider. You have to use a GUID to
' reference the schema, as provider-specific schemas are not
' listed in ADO's type library for schema rowsets

Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

'Output the list of all users in the current database.

Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
"", rs.Fields(2).Name, rs.Fields(3).Name

While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), _
rs.Fields(2), rs.Fields(3)
rs.MoveNext
Wend

End Sub

View 7 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

Help Needed

Apr 29, 2005

I need some help on a database that is set up for work use.

It's rather large and I have no technicial knowledge of access whatsoever so an answer in plain english would be appreciated.

I have attached a picture of the screen that i am having the problem with. The blank fields contain peoples names and addresses. On this page i have to click on "update service user" on the first user, the database opens a seperate page and i enter a few details, then i click to go back to this screen.

When I return back to the screen, the scroll bar is at the top of the list. This is OK when I am doing the first few letters of the alphabet (the users are listed alphabetically) but when i have too use the scroll bar and choose the letters later down the list, then click to update then return to the screen and the scroll barr is not where i left it...ie: it's at the top.

So what I am asking is, is there a way of freezing this scroll bar so it will stay there even when i have navigated away from the screen to update each user?

If someone could answer me this query then I would be most grateful as it's quite time consuming for me to use the scroll bar and find the next person that i need to update.

View 2 Replies View Related

Help Needed!!

Mar 15, 2006

Hi, looking for help big time!! I am a novice at using MS Access and struggling like hell. I have been set a project at University that requires me to import data from Excel, sort the data (i.e the data imported will be for a whole year and I am only interested in looking at single months), use calculations on the data imported and display this graphically. Is this possible with Access?? Any help will be gladly received as Im desperate.:(

View 1 Replies View Related

Help Needed

Sep 18, 2006

I have a multiple user access database on share drive with user-security level created. I created myself as administrator, and remove default Admin from Admin group. Removed permission from user group and joined workgroup file which I created as "MBS work group.mdw". I created shortcut on user's computer. I believe the syntax is correct

"C:Program FilesOffice 2003OFFICE11MSACCESS.EXE" /wrkgrp "\ServerNameMBS DatabaseMBS Work Group.mdw" "\ServerNameMBS DatabaseMBS.mdb"

Everything works fine. When I directly double click the database (MBS.mdb), it pops up a login box. However, when other user double clicks the database directly (not from shortcut) from their station, login window doesn't pop up. It allows them to access the database. I saw the work group file used default System.mdw

My question is how can I restrict them by double clicking the database without go through shortcut? Why my database security not protect user access without give user name and password. I tried by joined user’s work group file to MBS work group.mdw. It works, but I don’t want let user manually to do that one by one.

Is there anybody can help me go through this problem?

View 10 Replies View Related

Help Needed,

Dec 27, 2006

Sorry, i dont know where should i post this( under which category)

so i just post it here,

I want to create a login page using access,
and then i wanted to record down the name of the user and the time and date(login and log out) when he/she is using the database.

And then record it down in a table.

Any ideas fellow forumers :)

View 3 Replies View Related

Help Needed....

Jan 11, 2007

Hi,

I am fairly new to DB's and have been trying to get my head round a database I want to build. I have had a few pointers from other people on here which has helped etc.

I was wondering if anyone out there would mind helping me with this project. I will go into detail if anyone is interested. I am hoping that someone would let me add them to messenger so when I get stuck etc, I could drop them a quick note. I am not going to harrass you every minute of the day (I promise not to try to anyway :D ). I would like to work with someone so I dont have to keep explaining it to someone different each time.

If this is something that someone wouldnt mind doing, please, please, please let me know.

Many thanks

Jamie

View 2 Replies View Related

Help Needed Please

Apr 21, 2007

So far I haven’t got help on my DB.
I am attaching my DB.
The DB has two tables: DiaryTable & RBCaseTable
I want to resolve two issues on this DB

First issue: The DyNo field will start from No.1 on new year (DMax function). Since there will be duplicate records with the same DyNo for every year, I want to filter the records year-wise. For the current year, I should be able to do data entry, edit, search, print etc. For the previous year’s records, no data entry should be allowed and only search and print to be allowed.

Second issue: Two fields in both the tables are same i.e. DyNo and Remarks. I want this to be linked. What I want to do is that after I open ‘frmRBCaseAdd’ when I type the DyNo, the form should show the ‘Remarks’ field of DiaryTable so that I could update/edit.

I know nothing about VBA coding etc. Whatever codes I put in this DB was obtained from this forum and I simply made changes to suit my requirements. However, I failed to get help on these two issues. I shall be grateful if you could kindly help me. Thanks in advance.

View 4 Replies View Related

Help Needed Please

May 9, 2007

I need help please.

1. I have a [CmdBtn] to do some calculation on the first day of every month.(The Btn and calculation code are ready and working).

2. On clicking, the [CmdBtn] will look for [FieldTotal] entry. If no entry, it will execute.(This code is also fine and working).

3. While executing the command, it will populate the [FieldTotal] automatically so that second clicking of [CmdBtn] will take no action and the populated field will tell the user that calculation is already done.(Code for auto-populating is also fine and working)

4. On the last day of the month, the [FieldTotal] entry will be deleted.(Here also the code works fine.).

I have two tables Table1 & Table2. I have the form for Table1. The [FieldTotal] is in Table2. I inserted a TextBox in form and tried to link it to Table2.FieldTotal throu Data-ControlSource, but it is not working. When I open the form ‘#Name?’ appears in the [FieldTotal]. I tried changing the field property to Text and then Number. In both options, I get the same ‘#Name?’.

Interestingly, when I leave the text box as it is without linking it to Table2, the [FieldTotal] in my form appears blank. Here I am able to populate the [FieldTotal]. But when I exit and reopen the form, the text box is again blank.

Please guide me (1) in linking the Table2.[FieldTotal] to my text box in form (which is based on Table1) or (2) how to keep the text box entry permanent till the end of the month.

View 1 Replies View Related

Help Needed

Oct 10, 2007

Hello, i need simple database for my artworks. i made a few tables, but now i have to connect them and add some features. Also i will need a few reports... i think i will not be able to do it mysef. so i am looking for help... does anybody interested in this project? i will pay with Paypal. please, let me know
thank you,
Elena.

View 4 Replies View Related

Just What I Needed

Nov 4, 2007

i'm eric. joining a couple boards and looking
forward to participating. hehe unless i get
too distracted!

eric

View 6 Replies View Related

Help Needed!

Nov 8, 2007

I am a novice and need help, i have built a simple database and i need to find out how to automatically update files across a network as soon as possible it updates on a couple of machines strait away but on others i have to close the database and then reopen it to get the updates. In addition to this i want to be able to search for a reference at the click of a button.
Any help on this would be greatly appricated as i am a novice
Thanks

View 10 Replies View Related

SQL - VBA Help Needed!!

Feb 8, 2008

Ok i have a database works fine just run into a little porblem..
In My VBA Coding i have made a SQL quiery the code is..

Private Sub Form_AfterInsert()

DBEngine(0)(0).Execute "INSERT INTO availability (ID) " & _
" VALUES (" & Me.ID & ")", dbFailOnError

'---------------------- Below Is The Code That -----------------------
'-------------------------- Doesn't Work -----------------------------

DBEngine(0)(0).Execute "INSERT INTO availability (Name) " & _
" VALUES (" & Me.Name & ")", dbFailOnError

'----------------------------------------------------------------------

End Sub



ok so the insert of ID works but the insert of Name does not..

Am i doing something wrong?? can somebody help please i need it urgent..

P.S.
i have been using MySQL for about a Year working on PHP and it seems much different from this SQL here on access.. and my suggestion would look something like this

"INSERT INTO availability ('ID','Name'), VALUES ('Me.ID','Me.Name')


Something along Those Lines..

- Alan

View 1 Replies View Related

Help Needed Pls

Nov 16, 2004

:confused: Hi, am new here & i need some help with some access database. Its for a little project am using to learn access.

Ok am designing a website for an airline company using access as d database end & asp for coding & stuff. My problem is a table i called flight. I have to write out a flight schedule in d database but am not sure how to do it, i wrote a schedule down in words using days. let me explain that, what i did was i have about 10 countries my airline company flies to, so what i did was grp 5 countries to fly mondays,weds,fridays & sundays & d other 5 fly tuesdays,thursdays & saturday. I don't know how to put that in the table since in d frontend customers are supposed to be able to search by date. On the frontend is a drop down menu where they pick a date like 29th november 2004 & then it shows d flight details but my problem is i wrote it in days. what should i do?? :confused:

View 5 Replies View Related







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