Suitability of relationships

samedi 28 février 2015

I am constructing a database for a travel agent and was wondering if anyone can advise the suitability of this relationship structure.



The narrative is;

  • Customer requests quote for travel package

  • Customer is created

  • Booking is constructed assigning a Customer

  • Guests are assigned to booking

  • Products are attached to Guests




Attached is the relationship table.



I can't help wondering that this structure is too complicated and this is causing problems when I try to edit transactions (I have already commenced developing and testing).




Attached Images





File Type: jpg Relationships.JPG (43.6 KB)



Suitability of relationships

Color text field based on the value of a combo box

Hello to everyone,



I have a problem that is probably the result of lack of of knowledge in Access VBA. The situation is the following:



I have a table named ColorValues with the following three fields:

- ID

- MunsellCode

- RGBValue



30 fields from another table called Color_Analysis are linked to the above with one to many relationships (I've already thought of other ways to normalize data, but this is the most efficient, so no need to go into this topic).



Now, I've constructed a form for Color_Analysis and all 30 fields recording color are included as combo boxes bounded on the ID in ColorValues and displaying the MunsellCode for the user. I've also created unbounded text fields next to the combo boxes and want to use them to display the color that the user selected in the ComboBox. The question is how do I do this?



Essentially I need a piece of code that picks up the value of the combo box (this is essentially the ID in ColorValues), looks up that value in the ID column of the ColorValues table and uses the corresponding RGBValue of the same table as the .BackColor for the unbounded text field.



If anyone could help, it would be awesome! Thank you in advance for even looking. :D

Color text field based on the value of a combo box

Comparing two tables

I have searched on this and cannot find a thread that seems to match want I need to do.

As part of a database I have 2 tables. One which has players added to it and the other (foursomes table) is filled with data from the players table when user collects data using a form. The user selects three players from the players table and combines them into one record in the foursomes table. I need to compare the two tables to see if the player listed in the players table is now showing up within the records on the foursomes table. The players only that have the two check boxes - Block Entry and Day 3 Only - as true are eligible to be in the foursomes table.

I have attached the two tables to this thread hoping the above makes sense.:banghead:




Attached Files





File Type: accdb Tables compare.accdb (1.71 MB)



Comparing two tables

Input in pivot like form

Dear reader



I have a table like

DATE SOURCE MEASUREMENT

date1 sensor1 value

date1 sensor2 value

date2 sensor1 value

date2 sensor2 value

date3 sensor1 value

date3 sensor2 value

etc..



Has somebody a tip to create a pivot like input form with for example



SOURCE date1 date2 date3 ... date7

sensor1 value value value ... value

sensor2 value value value ... value



So that we can enter all the details for one week on one form

Thanks for thinking with me



Regards,



Ben

Input in pivot like form

How can I change font name

Is it possible to conditionally change a font name? Report field is set for Wingdings 2 so I can print a check mark if underlying value is true. Wanting to change back to calibri to print "X" if not true. Haven't been able change it in an if statement. A macro setvalue fieldname.fontname to "calibri" throws type mismatch error. Setproperty choices don't include fontname.

How can I change font name

Appropriate place to find a developer?

I am trying to be polite and not wishing to introduce a commercial aspect into what is obviously a technical forum, but I am having difficulty finding someone local to me (Wirral/Liverpool/Chester - UK) to develop a fairly simple? MS Access application for me. Would this forum be an appropriate place to post a request for help and which area would be best to post in?

If not this forum any other ideas where to get help?

Appropriate place to find a developer?

Question auto reject of holiday

alright guys and girls,



just a question i am hoping for help on,



i have been serching the web and this site in terms of how to do this.



run down is...

i have a database.all the desgin and layoutas are done and adding functionallity now but i am looking for it to have holiday input form where if i enter a employee holiday then it can use a rule that if there are 3 ppl off that day it will show reject status and option to gererate a pre-formated letter in work for easy print.



i dont even know if this can be done so if anyone can advise on this???



i have got the pre generated letter,i have the employee database tables,i have emplyee form where i can add and remove employee.



i am very new and came along way but just can understand oh to tie together a yearly holiday form into bookmarks on word document with lookup.



please help me out guys



kind regards

Question auto reject of holiday

hello there

hello there, im screedy and i am currently working with access,this site has been fantastic for help over the last couple of days with helping be build my database tools

hello there

Hi All

Hi everyone,



Access enthusiast living in the central Belt of Scotland.



I've been using access for many years in various jobs. Always finding new challenges to my applications.



Look forward to learning new code & methods.



Currently looking at MRP systems & how to design & implement them.



Cheers



DaveK

Hi All

Pop Up Error Msg box sounds

I searched the forum for this topic to no avail....would appreciate it if someone could show me how to get a "sound" to occur everytime a certain message box pops up.



I wrote the following code which currently allows the MsgBox to open when the criteria is met, BUT it does not make a sound when opening. I followed the instructions as per this link (which I found when I googled the question) http://ift.tt/1DDCaNy







Private Sub Open_frmAccessories_Click()

If (Me!txtProductGroup) = 9 Then

MsgBox "This Product Does Not Have Any Accessories", -vbExclamation, "NO Accessories for this Product"

Exit Sub

Else



Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "frmAccess"



stLinkCriteria = "[AccessGrp]=" & "'" & Me![AccessGrp] & "'"



DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Open_frmAccessories_Cli:

End If

End Sub



I have attached a copy of the pop up box to show it is working correctly, albeit without the sound function. Curiously, if I click on any button in the Products main screen behind the Error Msg box, i.e. "New" or "Close" the SOUND occurs at that point!



Thank you in advance for your suggestions.




Attached Images









File Type: jpg Error-Msg-Sound-Code.jpg (48.2 KB)
File Type: jpg Error-Msg-PopUp.jpg (86.5 KB)



Pop Up Error Msg box sounds

Update a lot of values in a table at once from a form

I'm making a very basic sales system for my school project and I'm currently working on the stock management part, as I said it's very basic.



My task -
When the user receives a stock delivery they need to update the stock numbers. the value they need to update is the StockNumber value in the Products table. to so this I want to make a form that displays all the product names in a table with a textbox or cell next to it in which the user can enter the amount of that item that has been delivered. And at the bottom of the form there is a button which will add all these new values to the existing values.

Problem -
1. There is no set number of products, the user is able to add new ones, this is preventing me from just making a separate textbox for each existing product

2. Also I have no idea how to do this

I have attached a jpeg I made in paint to illustrate how I want to the form to work as well as my system as it currently stands, there are a few unused forms and queries.

If you can tell me how to make this form work it would be great and my system would be more or less complete, I'm just an amateur thrown in at the deep end by my school with this project.

(all the information currently in the system is either lorem or made up)

Any questions or additional info required please ask




Attached Images





File Type: jpg proposed form layout.jpg (85.7 KB)


Attached Files





File Type: zip ewan97_Database4.zip (169.1 KB)



Update a lot of values in a table at once from a form

Hello World! : )

Hi guys and girls



I am an Access enthusiast but still struggle to get my head round VBA as my business means constant interruptions if I do get the time to try and study. I am quite proficient at the basic stuff but am always coming up against the odd issue or two!



I have a database for my business (B & B) for recording details of guests and their details, from which I send all my regular emails as a report in PDF format exported to Outlook. The title and message fields are populated and the process is automated using queries and a set of command buttons on my parameter form.



What I would ideally like to do is pass the email address contained in the parameter form to the exported report, rather than having to copy and paste it as I currently do, thereby automating the process a little more. I think I saw something in a related thread which seemed to indicate this can only be done by coding Outlook.



Does anyone know if there's a way of doing so using the Expression Builder?



It would be mighty helpful if you do, thanks.



Mick

Hello World! : )

Different front end design, same BE

Up until now my db's have had only a couple of users and our front ends are essentially the same - except mine is an mdb (now that I'm on 2013 it's an ACCDB) and the other user has an mde.

I'm adding a new user with different needs and I will design different forms and functions for the new user. He will still be connected to the same back end as me and the other user.

Are there any issues - anything I should keep in mind here? This doesn't seem all that tricky but it is new to me to do this - I always just update the mde every so often as I develop my accdb. Actually, until I do update the mde, she does have a different front end than I do - I update her maybe once a month or so. I develop a lot of functions that only I use.

SO anyway - any tips or warnings?

Thanks

Different front end design, same BE

CDO SMTP Email Relays

Has anyone else experienced an interruption to the relay mail services on the http://ift.tt/1aBPZml servers?

CDO SMTP Email Relays

Hello from Scotland

Hi All,



I recently moved to Scotland, 30 miles south of Edinburgh, from New York where I lived for over 30 years. Originally I came from Japan and went to US to study. Well my life is full of unexpected turns to say the least, but I am enjoying the beautiful Scotland now with my Scottish-Canadian wife together with her 2 cats.



I consider myself a seasoned Access programmer, but every time I start writing a new program I discover new challenges. I will appreciate helps from other Access users and I would be happy to throw in my two cents wherever I can.



Shoji

Hello from Scotland

Lookup using part of a field

Hi guys



I am having a hard time figuring this one out.



I have a table - RDC/NDC - that holds details about various warehouses, including a field - [Short_Code] (TEXT) - to hold the warehouse short code or ID.



I have an import table - PickDataImport - that contains details of goods picked, including a field - ToAssignRef (TEXT) - that is made up of 3 elements; Type-Short_Code-Date (EG GREEN-MAN-210215).



I am trying to create a query that will return the warehouse name from RDC/NDC by looking up the depot short code in the ToAssignRef.



The Type element of ToAssignRef can be any length of text.



I am thinking i need to use HAVING or IN (or a combination) but everything i try fails - either blank or errors.

Lookup using part of a field

Database engine does not recognize 'payment' as a valid field name or expression

vendredi 27 février 2015

Hi all --



I've tried various searches for my probably simple problem but no success.

I have a small database for producing various financial reports, by date period (from/to). It works perfectly except when there are either no payment records or no receipt records for the chosen period. Naturally enough, MS Access comes up with the message "Database engine does not recognize 'payment' as a valid field name or expression" --- !!!



Is there some way I can tell MS Access that I don't mind if eg the payment column result is zero?



The structure of the table on which the report is based (via a crosstab query) is :



transaction date

auto number ID

transaction type (either payment or receipt, chosen by form's drop down box) - TEXT

amount - CURRENCY

receipt type - TEXT

payment type - TEXT

fundno - TEXT



The crosstab query design is as per the attached jpeg file





Hope you can help. If you need further information, I'm happy to provide (but know only basic stuff)



EdK




Attached Images





File Type: jpg crosstab.JPG (75.9 KB)



Database engine does not recognize 'payment' as a valid field name or expression

Append Query not appending entire table

Hello,



I have a local table that I am trying to append to a linked table. The fields are exactly the same. When I try to append the entire local table to the linked table I get an error code.



ODBC- insert on a link table failed.

[ctreeSQL]-17002 CT- Key value already exists in index (linked table field) (#-17002)



If I specify the criteria in the field to refer to a specific value in the local table, it updates it just fine. I want an append query because I don't want to manually update 500+ records!! I don't believe an update query would work because the values are not in the current linked table... so nothing to update!



:banghead::banghead::banghead::banghead:

Append Query not appending entire table

Duplicates

I have a report and know how to hide duplicates. On this report I am hiding certain fields but not all of them.

For 2 fields I actually want to highlight the duplicates so instead of hiding I'd like to maybe out put a load of "*"s.



e.g instead of

1041081018…..JOB-046-14…..24-Feb-14…...ABC…..…...….....Switches off….…..…....Cable Faulty…….....Comp717-R……Cable

…..…..…..…..….JOB-030-14…..06-Feb-14….......…….…..... …..Intermittent Hanging….Flash problem. …...Comp962-R……USB

…..…..…..…..…..…..…..…..…..…..…..…..…..….......….… ...….....Intermittent Hanging...Flash problem.......Comp163-R. …..HD

…..…..…..…..…..…..…..…..…..…..…..…..…..…..…......… .……...Intermittent Hanging....Flash problem.......Comp167-R…....dimm

…..…..…..…..…..JOB-186-14. …..18-Jul-14…..…..…..…..... …...Freezes....................Freezes..........…. ..







I want



1041081018…..JOB-046-14…..24-Feb-14…...ABC…..…...….....Switches off….…..…....Cable Faulty…….....Comp717-R……Cable

…..…..…..…..….JOB-030-14…..06-Feb-14….......…….…..... …..Intermittent Hanging….Flash problem. …...Comp962-R……USB

…..…..…..…..…..…..…..…..…..…..…..…..…..….......….… ...….....Intermittent Hanging...Flash problem.......Comp163-R. …..HD

…..…..…..…..…..…..…..…..…..…..…..…..…..…..…......… ..……...Intermittent Hanging....Flash problem.......Comp167-R…....dimm

…..…..…..…..…..JOB-186-14. …..18-Jul-14…..…..….…..... …...Freezes....................Freezes..........…. ..********........********



Any help gratefully re

Duplicates

Programatically joining templates?

To cut a long story short, is there a way to join a template from a VBA loop?



eg - for a simple doc, I do:




Code:



for a = 0 to x

Documents.Add Template:=sName + "file.dot"

With ActiveDocument

' add bookmark stuff etc

End with

Next x



Now, depending in the selection in the userform, they may create one or more copies of the same file.dot (with different information in each)



Rather than output multiple docs, how can I join the outputted doc as one document?



Note - this is just one of about 20 different templates in the project.

Programatically joining templates?

Use only the first letter from a word

Hi all,



I'm creating a folder with values from some fields. It all goes OK, but, the only thing is that the name of the folder could get to long.

We use words like "Prototype Model" "Prototype Review" Next Date Review" "Next Prototype Review"

How could I end up with only the first letter from each word like "PM" "PR" "NDR" "NPR" ?



Greetings.

Use only the first letter from a word

getting my layout in a datasheet form to stay

this is driving me bonkers, I have a datasheet form that is based off a query and is not editable due to expressions in the query. you might be asking why do you have a form that is not editable? well that's because the query im using has expression names that wouldn't be useful to another user and thus I need to edit them to read appropriate labels, thus the need to make it a form



Problem is.... I want to change the order of the fields and the widths of the fields but every time I load back in it has reverted back to its old state and looks horrid. I have found that if I change a value in my other datasheet forms after changing the layout it will save the layout but since I cant do that with this form I cant get the layout to stay



so how do I save the layout of my datasheet form and get it to stay?

getting my layout in a datasheet form to stay

Login name - update field on subform

I have an access 2010 database with an initial form for user login. After selecting their login, users go to the main tabbed navigation form. On the first tab, I have form with a dashboard as a subform containing a field that says "Welcome" with the user's name (obtained from the login). My problem is, users have to click on the subform for the name field to update. For the life of me, I can't figure out how to have the name automatically populate when the login form closes.

Login name - update field on subform

Bailed out Royal Bank of Scotland pays Huge bonus despite 3.5B in Losses

On another discussion, many people thought Union Workers, programmers, or other professions were making too much money. How about the amount Zombie Bankers make?

News Release Today:

Royal Bank of Scotland (RBS) chief Ross McEwan reported the 80 percent state-owned bank will pay staff amazing bonuses from a pool of £421 million. This bonus will be paid despite the fact RBS losses of £3.5 billion in 2014.



In 2012 RBS became insolvent. It was Too Big To Fail and received a £45 billion bailout at UK taxpayers’ expense.



While the acting RBS Chief McEwan has declined to take any bonus for a 2nd year, he commented on bonuses awarded to other RBS staff: People are “quite right” to view them as “outrageous.”

Bailed out Royal Bank of Scotland pays Huge bonus despite 3.5B in Losses

Question Sync Databases nightly

We have a network or server issue that makes the database really slow for anyone outside of San Francisco because that's where our shared drive is stored.



Is it possible to sync a copy of the database that the rest of the country would enter information to the one San francisco people would enter into, like nightly?



In other words, 2 of the exact same databases but they sync nightly so that both databases in the morning are the same.





The database isn't evem big at all. FrontEnd is 2500 KB and BackEnd is 2600 KB.



I can't put it on the SharePoint site because our company decided not to allow that. Don't get me started on the functionality with SharePoint they took away from us.



thanks so much for your help!

Question Sync Databases nightly

Nested IIF statements in a query expression

In an expression, I am getting a syntax error message when I try to run the query with nested IFF statements involving numbers in different ranges. Would anyone please help me with the correct syntax. Thanks very much.





=IIF([TableA]>-1,"On or Ahead of Target", IIF([TableA] is between -1<and>-9,"Behind 1-9 Days", IIF([TableA] is between -10<and>-14,"Behind Two Weeks", "Over Three Weeks Behind")))

Nested IIF statements in a query expression

Adding table to back end using VBA

Can I create a table in the back end of my database using VBA in the front end? My client is using this system and I can't easily go to their location. I need to create a table on the back end and have it available in the front end applications. My thought is to create a front end only for the purpose of updating the backend with this new table. My idea is now to have it open with a button for the user to click - this will add the table to the backend with the required fields, confirm the update was completed and then close. This app then would be trashed so it would not be run again. (Though I would put a check in the VBA that if the table existed, the user would get a message box and the coding stopped to avoid overwriting the existing file.)



And once the table is created, is there a way to programmatically link it to the front end. I will be providing a new front end with this update so I could add something in the new version.



All help greatly appreciated



Sue

Adding table to back end using VBA

Combo Jumps

I had a user ask me if repeated typing of the same letter can cause a combo box to move to the next one. It's tough to describe, so here is the example.



The combo box lists states by their two letter abbreviation. You hit c and it goes to CA, California. She wants to hit c again and have it jump to CO for Colorado, and c again to finally get to CT, Connecticut, where we live. However, after the second c is entered the combo has cc in it and no matching record. It's not a big deal, I just thought if someone had come across this before, there might be an easy answer.

Thanks

Privateer

Combo Jumps

Report based on a combination of 2 queries.

I have a database that reports activities by region.



Each week, my regional volunteers report statistics on a number of club activities. This is in the form of zero to theoretically infinite activity reports that they enter on a website. I download the .csv from the website, add the activity reports to the activity table and send them a totals summary every now and then.



The summary report shows figures for every club in the region, even if no activity reports have been entered for that club that week or ever.



This works fine, including forcing the query to return zeros when no reports have been submitted for that club.



What I want to do is have the report also show (in brackets next to each figure) the position as it was X number of days previously.



I can make the query and report to show the figures now.



I can make the query and report to show the figures X days ago.



What I cannot work out is how to combine the two queries into one report source so that I can get



Club 1 100(50) 75(0) 45(45)

Club 2 0(0) 0(0) 0(0)

Club 3 20(19) 0(0) 200(50)



etc



If I try and make a third query that gets the sums from qryNow and the sums from qryXdaysago for each record in qryClubsByRegion, I get two lines for each club.



:banghead:







Can someone point me in the right direction, please?

Report based on a combination of 2 queries.

Access - Get subForm datasheet value of row

I have a subform which is created with textbox and some command button in the top of the window, so this will simulate like a Datagrid.



http: // imgur.com/MpIpksT



This is how it looks my datagrid when it fills from a Query.



http: // imgur.com/kxAS8Ff



What I want is when I select a row from my subform, I want to Click the button "Cambiar", and get the value of the machine selected.



http: // imgur.com/LCEQlSI

Access - Get subForm datasheet value of row

Subform doesn't update after values being updated by another form

Hi,



I'm running into an issue with my forms.

I have a form that contains a subform, that contains a list of projects. This list is read-only. To update a record, you can double click on it, which opens another form filtered on this record, and which contains the fields in the first form as well as some others.

I have a command button on that last form to "Save and close", which fires up a macro that saves the record and closes the window.



Now, the issue that I'm having is that, when the window closes and I'm once again in front of the first form with the list of projects, the values of the record I changed are not updated and when I click on another record, Access tells me there's a conflict in the values and asks me if I want to keep the changes, discard them or copy to the clipboard.

It seems to consider the old values from the first form as a change, and thus asks me which to keep between these, and the actual (proper) changes I made in the dedicated form.

For the proper changes to be applied, I need to select "Drop changes".



I tried to requery the first form, also undo the changes to it after closing the window, but none of that worked.



Do you have any idea why it would do that?



I'm actually basing this on one of the templates, which does exactly what I want and which obviously works...

Subform doesn't update after values being updated by another form

Using a date field to create folder name

Hi all,



Is there a way to use a field with date in it to create a folder?

the field has a data like this 15/05/2014 in it and the / will not work in folder creation. So I was wondering how to get around it.



Any idea how to use:




Code:



MkDir "c:\Test\Access" & Me.Date_In & "/"


Greetings.

Using a date field to create folder name

Data Entry System - Struggling to produce the concept

I need some help getting my head around a possible data entry form i need to produce for my system here at work.



I'm more than a bit rusty on Access but really eager to get this working.



I'm really struggling to see how i would do it despite Googling a'plenty on possible solutions: I feel like I've looked into it far too much and have just walked in circles to a point where i'm just missing something now. Perhaps this is actually extremely easy.



My goal is to speed up my Data entry system significantly. At present i'm able to scan a bar code and enter in the relevant data that is applicable to the unit that the bar code is sourced from. When multiplied this quickly becomes a long task: A Repetitive task where i have to keep repeating the same data.



I want to be able to predetermine the data for the batch of units i'm about to scan into the system and then scan a bar code and save it: Often no other field will need changing when scanning multiple units.

If we say that i'm entering ten units. All of which have six of the same fields, date sent, software version, model version what have you. I want to remove the need to repeat that on each new record.



I've played with the idea of having the form remember the previous record entry or using a form to edit a sub form but i would really love some guidance as to whether this is possible. You can almost think of it as setting the template for the batch and scanning in each bar code which then auto fills the fields based on that template. I would then save the record and ultimately: save a lot of time.



The form would all save to one table. 'Units'. This is a running count of all processed units. The form will also draw on other tables for choosing existing clients and specialized versions of units. All this exists as present. I'm struggling to put together a concept for completely eliminating repeated data. Would remembering a past records input be the better way of handling this? I really need some help in clearing my mind and pinning down a technique.



I would really appreciate any guidance, help or suggestions on this one.

Anything you need to know from me, i'll do my best to provide.



I have an image diagram as a proof of concept example but i am unable to post it.

Data Entry System - Struggling to produce the concept

Continuous Form Not Updating Tables Correctly

I have a continuous form that is using a select query to populate all of the bound controls. The drop downs and text boxes are displaying the values from the correct places. But, the form is not updating in the places I expected. Any information/help would be greatly appreciated!



The select query that is being used to populate, combines information from 3 tables.

  1. 'TimeEntries' table (the one that I want records to be updated in). This holds employee ID, and numeric values for Project Name and Project Task.

  2. 'ProjectInfo' table (nothing should be updated here). This table holds other details about the project (ex. Project Name) that is used to populate a combo box.

  3. 'ProjectTasks' table (nothing should be updated here either). This table holds details about project task (ex. Task Description) that is used to populate a combo box.


The issue I am having is that when records are updated on the form, they are adding records to all 3 tables that are a part of the query, instead of just updating the time entries table.



Record Source (form) = Select Query "EmployeeTimeEntry"



Thanks in advance. :confused:

Continuous Form Not Updating Tables Correctly

I need to get the Top 10 per State and County

Hello Everyone,

I am trying to get the Top 10 NPI's by State and By County based on the Current_Year_Members_Outreached. Below is the query I created but I haven't been able to verify if the results are correct because when I execute it runs and some results show but in the lower right corner of the screen it says "Formatting Page" and seems to be taking forever. My source table only has 67k records which doesn't seem like a lot. So, I have two questions:

1. Does my query below look correct based on what I am trying to achieve?

2. Is there a better way to right this query to get better performance?





As always any help is greatly appreciated....








Code:





SELECT

A.STATE,

A.COUNTY,

A.NPI,

A.[SumOfCurrent Year Members Outreached]

FROM Qry_Provider_Distinct AS A

WHERE A.[SumOfCurrent Year Members Outreached] =

(

SELECT TOP 10

B.[SumOfCurrent Year Members Outreached]

FROM Qry_Provider_Distinct AS B

WHERE A.STATE = B.STATE AND A.COUNTY = B.COUNTY AND A.NPI = B.NPI

ORDER BY

B.[SumOfCurrent Year Members Outreached] DESC

)




I need to get the Top 10 per State and County

Show users logged into database

I was reading this thread in the hopes of shedding some light on an issue and I wondered if anyone had any more insight.



http://ift.tt/1BmeZs6



I have a database that I converted from Access 2003 to Access 2010. In the database I already had the following module saved.



http://ift.tt/1LQ9Byn



In order to make this work, the Microsoft ActiveX Data Objects 2.1 Library check box is selected in the References. However, I found that I cannot have this reference checked in Access 2010 as it kicks back a Type Mismatch runtime error in another part of my database.



Does anyone out there have something similar to the KB285822 that will show the current users logged into an Access 2010 database?

Show users logged into database

Having Name Show on Form After Logging in

Hi,



I am trying to add the name of the employee show up in on the opening form after logging into the database. I am able to get the user right (Admin only), but not the name. In the Default Value in Properties, I have it set to =CurrentUser() and I have the Employee field in the Control Source to record current user.



How can I make this so it indicate the user logged in?



Thank you.

Having Name Show on Form After Logging in

Viewing The Output Of SQL Statements (i.e. "Debug.Print")

The following SQL statements run with no errors, but I can't see the output of the SQL statements. What is wrong with my "Debug.Print" or "rs" statement ? I would like to see the results. The SQL statements works when I save them to a query. Thanks ! ! !





Dim db As DAO.Database

Dim rs As DAO.Recordset

Rem Dim intResult As Integer

Dim strSQL As String



Set db = CurrentDb



strSQL = "SELECT Table_Payee_List.PayeeSelectBox, Table_Category_List.Category FROM Table_Payee_List INNER JOIN (Table_Category_List INNER JOIN Table_Payee_Category_Junction ON Table_Category_List.CategoryID=Table_Payee_Categor y_Junction.CategoryID) ON Table_Payee_List.PayeeSelectBox=Table_Payee_Catego ry_Junction.PayeeSelectBox " & _

"WHERE (((Table_Category_List.Category) = ""710A-College Students""));"



Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)



intResult = rs

Debug.Print



rs.Close

db.Close

Viewing The Output Of SQL Statements (i.e. "Debug.Print")

Hide field in Unfiltered Report

Not sure if this can be done, but giving it a shot.



I'll start from the beginning and work through it.



I have a form that has a drop down box with all of my project numbers in it. when I choose a project number, I can then choose from several report buttons on that same page that opens a report just showing that projects info (easy enough). I then have different report buttons that open those same reports, but showing every project (no filter).



The reports have a cover page that has the field, 'project number' in the front, so when a particular project is chosen from the drop down, that project number will show on the cover page (still pretty easy).



My question is, when I open the full report(no filter), is there a way to tell the report not to show the 'project number' field? since the full reports show every project, the 'project number' field will show the first project number, which is not what I want to do.



I tried to be as simple as I could, if you need further clarification, please let me know.



Thank you in advance!!

Hide field in Unfiltered Report

New member ...

hello, am Antony Matoi from Kenya and i like programming generally:i.e all programming languages but am new to ms access programming. all i do is developing databases using ms access but not complete ms access database systems, i would like to learn more from colleagues and also contribute what i know in the same so that we can have as many access programmers as possible.

New member ...

DLookup problem in Form.

Ok, now that I'm beginning to enjoy myself, and having moved to MS Access 2010, I've found some things easier....but not all.



I have a Purchases form, with a Combo Box storing a Contact Code (CCode).

I want to display the Contact Name relating to the CCode in an Unbound Text Box (called CompanyName) and have this auto looked up when the value in the Combo box changes.



I worked through all the help and tried to use DLookup in a procedure After Updating the Combo Box. I have added the error I am getting below.



Private Sub Combo15_AfterUpdate ()

strFilter = "CCode = " & Me!CCode

Me!CompanyName = DLookup ("CCompany", "Contacts", strFilter)

End Sub



Returns this error in DeBug: strFilter = "CCode = COS001" (COS001 is a valid CCode)





I know I'm not far off, but something is messing this all up. Any help would be much appreciated as I'm working around this but it's niggling me.

DLookup problem in Form.

Unit Stake / Rounding Calculations....

Hi All

I am trying to come up with a cell combo that will do the following ..



When betting, sometimes it is necessary to consider a minimum stake. When the stakes are calculated automatically, it is necessary to round up the calculated stake in accordance and to the nearest unit stake.



Consider the following :

Variables :

Rounding Direction : Up/Down

Unit stake as shown in each example below...



Exmaples :

Unit stake : 0.10p

Stake : £4.34 -> is rounded UP to £4.40

Stake : £4.34 -> is rounded DOWN to £4.30



Unit stake : 0.20p

Stake : £4.34 -> is rounded UP to £4.40

Stake : £4.34 -> is rounded DOWN to £4.20



Unit stake : 0.50p

Stake : £4.34 -> is rounded UP to £4.50

Stake : £4.34 -> is rounded DOWN to £4.00



Unit stake : £1.00

Stake : £4.34 -> is rounded UP to £5.00

Stake : £4.34 -> is rounded DOWN to £4.00



Trust this makes sense.....



Can anyone suggest a nice and reasonably simple way to do this in Excel please.....



Thank you in advance.

Unit Stake / Rounding Calculations....

READING mails from POP3/IMAP folder

I'm googling around for days to find a way to receive mails from POP3 or IMAP using VBA and store them in a MS-SQL Server database.

Reason for that is, that on our Windows Server 2008 there is NO Lotus Notes Client, NO Outlook, no other mail client installed.



While I can SEND via SMTP using CDO, I cannot find anything using VBA (!) for receiving mails or reading Mails.



The code should run in an access 2010 database (runtime) which is installed in every users server profile.



Thanks your help!

Michael

READING mails from POP3/IMAP folder

Hello all!

jeudi 26 février 2015

Well I just wanted to introduce myself. My name is Hugh. I just start with access last yr. I've built a few database so far. They track personnel and a ton of reports that use to take days to sort out. Currently working on a employee training tracking database. I'll post a stripped copy when completed. I hope to post more soon.

Hello all!

Keyboard shortcut Closing Query

Hi, can someone please remind me how I can close a parameter query without having to close the entire database and reopen again? [Alt] [f5] ??

Many thanks.

Keyboard shortcut Closing Query

change record that is part of composite key

I am creating a database that tracks the selling of products amongst other things.

The user will enter in an order and may delay invoicing until the customer approves the quote - at which time the order is turned into an invoice.



In the transactions table the OrderID, ProductID and CustomerID constitute a composite key.

I want to be able to view the order and change it by either deleting or adding ordered items (obviously prior to invoicing) but because the ProductID is part of the composite key I cannot delete a line item.

Perhaps the solution is to remove ProductID from the index or is there a better way?

I don't really want to add another field that marks the item as Deleted - if you know what I mean

change record that is part of composite key

change record that is part of composite key

I am creating a database that tracks the selling of products amongst other things.

The user will enter in an order and may delay invoicing until the customer approves the quote - at which time the order is turned into an invoice.



In the transactions table the OrderID, ProductID and CustomerID constitute a composite key.

I want to be able to view the order and change it by either deleting or adding ordered items (obviously prior to invoicing) but because the ProductID is part of the composite key I cannot delete a line item.

Perhaps the solution is to remove ProductID from the index or is there a better way?

I don't really want to add another field that marks the item as Deleted - if you know what I mean

change record that is part of composite key

Query to update table but no result

Hi

I have a created a query which I want to update a table. The field is called DTP. I have the Workingdays2 module in place as well as the Holidays Table. The dates (date only) are called Time in and Transaction date. I want the table to upate records only if the entry in Completed is Yes. I have attached screenshot of what I have in query. I am no good whatsoever at VBA so I used the Query design view. It shows how many records will be updated (which is a valid number) and shows me which field will be updated. However when I run the query and then opend the Table the DTP field is empty. Anybody have any ideas please?



Thanks




Attached Images





File Type: jpg DTP.jpg (34.5 KB)



Query to update table but no result

logged in person on all forms?

There is a DB with many forms and reports on which multiple employees are going to work. Is there an easy way to prompt each employee to enter his/her own password to be able to open the database?

Since it is important to record who has put data in forms, a column is designated to record the name or ID of the employee who is putting data. Is it possible that the logged-in employee name or ID, as the person who enters data, is put automatically in all forms / reports, etc. since he/she has already logged in?

thank you

logged in person on all forms?

Query report changed data

I created a query and one of the fields was "name". In the query it listed the names and then changed to the ID number of the names from the name table. The query was created using the wizard. Why did the query change to the ID number mid report and how do I get it to report only the names and not the ID number.



Thanks:confused:

Query report changed data

Access "Anti trim"

I have a local table where I am needing to change the primary key so it formatted the same way that a field is in a separate linked table.



In the linked table, the field is formatted to always be 10 characters. There is always a space at the end which is included in those 10 characters. In positions without a character, there is a space.



EX:

800= “(space)(space)(space)(space)(space)(space)800(spa ce)”

10155= “(space)(space)(space)(space)10155(space)”



In my local table, the field is trimmed.



EX:

800= “800”

10155= “10155”



This expression gives me the correct number of characters with a space at the end, but I need the zeros to be spaces instead of zeros.



Expression: Format([field],"000000000" & " ")



These fields are text fields and must stay that way. Any ideas?? Thank you!

Access "Anti trim"

Preserving characters from Excel Import to Access

I know this is a crazy request but I was wondering if this was possible or not. The excel worksheet that I am importing into my database has some formula's, for an example =2+2.



I am importing this worksheets, then checking fields against the main table, then exporting back to Excel. But I want to be able to keep the "=" signs when I import to remain so that when I export back into Excel the columns with the formulas will already be there.

Preserving characters from Excel Import to Access

Macro for sending emails

I created a macro in a form to send a report based on a query. I'm looking for a way to auto populate the email address field in outlook based on the query.



Thanks

Macro for sending emails

Macro for sending emails

I created a macro in a form to send a report based on a query. I'm looking for a way to auto populate the email address field in outlook based on the query.



Thanks

Macro for sending emails

How can I add VB code to refresh form after change?

I've been using VB in excel for years but new to it in Access. I'm working with a form someone else created and am adding a delete button. I've managed to add the button and get some code working which will delete a record from a table. The problem I'm having is that after the delete operation occurs all fields in the form, and the corresponding items below the form, show #Deleted in all fields. How can I force a refresh using code?

How can I add VB code to refresh form after change?

Split Memo Field in a query

Hi Guys,

Im not sure if this should be here or in vba?

I have a table that contains a memo that is delimited by line breaks. For each of these breaks i need a new record in the query results that i can then use in a Labelling application.



My current query looks something like:

ID | Product | Pack Size

1 | item a | 1x1000,1x1050

2 | item b | 1x1000,20x25

3 | item a | 1x1000

(Where the , is a new line)

Whereas my ideal output is:

ID | Product | PackSize

1 | Item a | 1x1000

1 | Item a | 1x1050

2 | Item b | 1x1000

2 | Item b | 20x25

etc.



I think im supposed to use the Split() Function though i dont have a clue wherw to start.

Thanks in Advance :)

Split Memo Field in a query

Project time Registration database

Dear readers,



I am looking for a simple time registration database in Access

Multiple users have to book hours on several projects.



Options:

Can build it myself

Try to find a database on the internet



Does anybody have a suggestion for me?



Many thanks



Ben

Project time Registration database

Blank Form

Hello!

This has probably already been asked / answered but I am having a tough time figuring this out. Hopefully the wise gurus here can help me out. :)



Ok, so I have a form that pops up when a certain selection is made in a drop down box and the SUBMIT CLAIM button is pressed. My problem is that every once in a while (it doesn't happen every time hence my issues in figuring out what causes it) the form will open completely blank. No headers, footers, fields - nothing. The user has to right click on the title bar of the form (it is a pop-up if that helps) to close it then hit the SUBMIT CLAIM button a second time and all of a sudden it works. I am at a loss - please help as my sanity can only take so much... :banghead:

Blank Form

One-Way ticket to Live on Mars - What kind of people will go? POLL

http://ift.tt/1AwGbUi



The article shows a break-down, rest assured that I am NOT the one person from Colorado. The news also claims 2 people from the UK were approved.



Is this another situation of billions being wasted to send people to death within 60 days? Is it a mankind's greatest endeavor to go down in history?



Why Mars instead of the Moon?

The Poll awaits - CHOOSE ALL THAT APPLY



By the way, I might have accidentally signed up a couple of you for this one-way ticket. So, if they grab you out of the pub and if Mars has Internet, be sure to drop us a line. LOL

One-Way ticket to Live on Mars - What kind of people will go? POLL

Find record in a subform

I have an unbound form: frm_ReceiptSearch with some fields that, when something is input, will search a datasheet viewed form on a subform on the main form (subform name is sf_frm_Receipts). Currently, on the txt_CheckNo field's after update event, I have the following code:



Private Sub txt_CheckNo_AfterUpdate()

Dim SrchVar As String



SrchVar = Me.txt_CheckNo



Me!sf_frm_Receipts!REFNO.SetFocus

DoCmd.FindRecord SrchVar, acEntire, , acSearchAll, , acCurrent, True

End Sub



but I'm getting a runtime error 438. Any suggestions?

Find record in a subform

Calling commandbutton_click event from a module

I have written the code on the commandbuttons click event and the code is present in the userform . Now Just wondering if its possible to call commandbutton_click event from the module. Like is there any want I can use from the module:


Code:



call commandbutton1_click


Thanks

Calling commandbutton_click event from a module

Sort Row Headings for Crosstab Query

Hi



I have a created a crosstab query which gives me the results I need, but I want to sort the row headings differently. These are not numbers, but machine sizes which range from 4 Metre to 20 Metre. Currently, the crosstab gives me:



10 Metre

12 Metre

14 Metre

17 Metre

20 Metre

3 Metre

4 Metre

5 Metre etc



But I need to show it as:



3 Metre

4 Metre

5 Metre

10 Metre

12 Metre

14 Metre

17 Metre etc.



The field is short text data type and data comes from an ODBC linked table to SQL server table, and I am using Access 2013.



What is the best way to achieve this for my query?



Many thanks

Martyn

Sort Row Headings for Crosstab Query

check if a field with number data type is blank

Hi Guys



The DolphinBatchNo has number data type but the following sql statement doesn't capture the ight records. it doesn't check id dolphinBatchNo is blank.




Code:



strsql="select * from `MasterTBL` where PolicyNumber>=" & TxtFPolNo & " and PolicyNumber<=" & TxtLPolNo & " and PolicyStatus='Live' and DolphinBatchNo is null order by PolicyNumber"


Thanks

check if a field with number data type is blank

Remove Blank Row on Continuous Form

On a continuous form, I would like the user will add a new record via button click instead of popping open a blank record at all times. With AllowAdditions set to False on Form load, and turning it back on button click I can get a new record added. I am having trouble determining where to turn it back off.

  • AfterInsert - doesn't seem to delete the blank row until I move to the blank row, so this doesn't accomplish what I am looking for.

  • AfterUpdate (for each field on continuous form) - this did what I wanted, but I was only able to update one field on the form for the new record. The combo boxes then were viewable, but I could not make a selection.


I am still learning Access but am proficient in VBA. Please help!! :)

Remove Blank Row on Continuous Form

Using a VBA function in SQL Query

Hi



I'm trying to use a VBA function that I specified myself in a SQL query.



My function is:



Public Function Test1(Tbl As String, Clmn As Integer)



Dim MyDb As dao.Database

Dim Tbldef As dao.TableDef

'Dim Tbl As String

Dim ColName As String

'Dim Clmn As Integer

Dim Que1 As dao.Recordset

Dim SqlStr1 As String



If MyDb Is Nothing Then

Set MyDb = CurrentDb()

End If



'Tbl = "PRICE2"

'Clmn = 1

Set Tbldef = MyDb.TableDefs(Tbl)

ColName = "[" & Tbldef.Fields(Clmn).Name & "]"

SqlStr1 = "SELECT " & ColName & " FROM " & Tbl

Set Que1 = MyDb.OpenRecordset(SqlStr1)

Dim dim1 As Integer

Que1.MoveLast

dim1 = Que1.RecordCount

Que1.MoveFirst

Dim MyArray1()

ReDim MyArray1(dim1)

Dim MovingDiff()

ReDim MovingDiff(dim1)



For i = 0 To dim1 - 1

MyArray1(i) = Que1.Fields(ColName)

On Error Resume Next

Que1.MoveNext

Next i



For i = 0 To dim1 - 1

MovingDiff(i) = MyArray1(i + 3) / MyArray1(i) - 1

On Error Resume Next

Que1.MoveNext

Next i



'Test1 = MovingDiff

For Each Item In MovingDiff

Debug.Print Item

Next

Test1 = MovingDiff()



End Function



I provide 2 parameters to the function: Tbl which contains time-series of different stocks and Clmn where I tell the function for which column I want the calculation to be done.



If I test the function in the VBA immediate window i get the correct result. However, if I run the following SQL Query in MS Access it doesn't return me any values:



SELECT PRICE2.TK, Test1("PRICE2",1) AS MDiff

FROM PRICE2;



Can someone tell me please what I'm doing wrong?



Thank you very much in advance.



Regards

Dario

Using a VBA function in SQL Query

Select data for continuous records in a report

For the report in question all data is taken from one table named "Completions £". The fields I will be using are as follows:




Code:



[Surname]

[Firstname]

[Branch]

[Quarter1_A]

[Quarter1_T]



When the records are added, the Branch is added using a combo box. There can be several rows of data with the same Firstname and Surname but with different Branches.



The report layout must look something like this:





I have tried using DLookup to select the data based on the data in the Name text box, but this just gets the first result and duplicates it.



Any help would be greatly appreciated!




Attached Images





File Type: png Question3img1.PNG (11.2 KB)



Select data for continuous records in a report

Flagging up dates

Hi all,



I've been asked to edit a current report that lists our production in week number order. I need to look at way we can 'flag up' orders that are within a 4 week period from the current date.



For example,



10 Orders in total in our database. 5 of which are due the drawings back within 4 weeks from today (26/02/15). I'm looking for a way for the report to show the 5 orders as priority, either by formatting the orders in bold, a different colour or under their own heading/group.



Could you recommend a way in which I can do this?



Regards,

Chris.

Flagging up dates

Data filtering by form/subform using same record set

good day !



I have a form and subform where i have table data in the subform and 03 Combo box in the main form header. I need to do some filtering using combox box1 and out of that filtered records i need to do one more filtering using combobox2. then again another filtering by Combobox3. ( same way we are doing in Excel)



Subform is running on a query where i have following fields;

Vessel

Voyage,

POL

POD

MLO



by Combo box 1 i need to filter Voyage

by Combo box 2 i need to filter POL ( out of the data filtered by above )

by combo box 3 i need to filter POD ( out of the data filtered by both above )



Kindly seek your assistance to write a suitable VBA codes. thanks in advance !

Data filtering by form/subform using same record set

complicated query

Hi



I have a table call ed Archive.

i need a query that would produce the following results

Must be within one query.



I'm after a distinct list of names

To look within the field Hashtag to find if there is text "#LEFT"

If there is i need the first Calendar date it appears against their name.

If there isnt a "#Left" then null



It need to have parameters in Calendar date to between Parameter1 and Parameter2 and also UploadDate = ?



The exact field names are

NAME (Text)

CalendarDate (Stored as DD/MM/YYYY)

HashTag (Text)

UploadDate (Stored as DD/MM/YYYY)

I also need to bring in

FUNCT (Text)

TeamNAME (Text)

Skill (Text)



Thanks



Rob

complicated query

password to forms

hi,




i have a form called departments . one that form i have 5 buttons

I want this form only to open when some logs onto the database

the buttons represent each department

1. sales

2 purchasing

etc etc




is it possible to assign a password to those buttons so each department has security to thier own form



steve

password to forms

How to use command button to select image and show it in an access form one after one

in the attached form i can select multiple image but my next and back button does not work ,also i want the path to the file shown above.to copy the name from there and paste it in the table,to write remarks,Plz help me to over come the issues if possible.thanks.




Attached Files





File Type: mdb Display Picture.mdb (448.0 KB)



How to use command button to select image and show it in an access form one after one

text box to show time taken

Hi guys



I have some vba that ends with a text box being displayed that says "file created"



I would like to add to that text box how long it took.



My initial thoughts are to add to the start of the code a variable that stores the current time (stTime)



and at the line before the text box is shown get the time again (endTime)

and subtract one from the other to get the time taken in mins and sec



How would I achieve this

text box to show time taken

text box to show time taken

Hi guys



I have some vba that ends with a text box being displayed that says "file created"



I would like to add to that text box how long it took.



My initial thoughts are to add to the start of the code a variable that stores the current time (stTime)



and at the line before the text box is shown get the time again (endTime)

and subtract one from the other to get the time taken in mins and sec



How would I achieve this

text box to show time taken

Question Access - Export to CSV file

Hi Guys,



I have an existing Access Database which has a lot data, new records get added every day and a few are modified as well.



I need to write a script/query/exe which will get modified records(since last execution of same script etc.) from Access and export them to a CSV file.



My problem is getting those modified records.. Is there any default timestamp field in Access which can be used? Or do I have to add a new timestamp column for every table?



Any suggestions?



Regards,

B

Question Access - Export to CSV file

Load folder content into attachments

mercredi 25 février 2015

Does anyone have a simple vba code that allows me to import all the content in a specific folder into an Access attachments field? I have search but all I am seeing is code to import outlook attachments. :banghead:

Load folder content into attachments

Rename Table Name to First Column Heading

I am importing different excel sheets into Access dB using a file dialog. The importing works fine however, I would like to rename the tables once they are imported to the name of the first column heading. Where exactly would I ad the name change at in this code?



#' Open the EXCEL file and read the worksheet names into a collection

Set colWorksheets = New Collection

Set objWorkbook = objExcel.Workbooks.Open(StrFileName, , blnReadOnly, , _

strPassword)

For lngCount = 1 To objWorkbook.Worksheets.Count

colWorksheets.Add objWorkbook.Worksheets(lngCount).Name



Next lngCount

' Close the EXCEL file without saving the file, and clean up the EXCEL objects

objWorkbook.Close False

Set objWorkbook = Nothing

If blnEXCEL = True Then objExcel.Quit

Set objExcel = Nothing

' Import the data from each worksheet into a separate table

For lngCount = colWorksheets.Count To 1 Step -1

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _

"tbl" & colWorksheets(lngCount), StrFileName, blnHasFieldNames, _

colWorksheets(lngCount) & "$"#

Rename Table Name to First Column Heading

Query to a

Hi there!



I have received much help here in the past and was hoping I could get an answer to this problem I'm having.



I have records using a select query that I am sending to a make table. I would like to have those records excluded from being used again for 180 days, at which point they can be used again. Essentially, I have an ID and an email address which gets stored in the Make Table. I would need to ensure that if we send an email out in Week 1, we do not send an email again for another 180 days if there is activity from that same ID. On day 181, the ID/email address can then be resent.



It may be something very simple I am just overlooking but any insight would be greatly appreciated.

Query to a

Another CDate() question

Hi All, Its been a while



I Keep getting an #Error result on the CDate function



1st step works fine

txtBookedDate: Trim(Mid([BookingDumpScreen],InStr([BookingDumpScreen],"P.")+4,8))

Answer as expected 07JAN15



2nd step converted the text to date

Tried BookedDate: CDate([txtBookedDate])

Answer #Error

Then tried BookedDate: CDate(Format([txtBookedDate],"dd/mm/yyyy"))

Answer #Error



I have tried so many combinations I have lost count. Even tried splitting the 07JAN15 date into a Day field then a Month and year field then build them all back together as dd/mm/yyyy see below



DateBookedDay: Left([txtBookedDate],2)

DateBookedMonth: Mid([txtBookedDate],3,3)

DateBookedYear: Mid([txtBookedDate],6,3)

DateBookedBuild: [DateBookedDay] & "/" & [DateBookedMonth] & "/" & [DateBookedYear]

BookedDate: CDate([DateBookedBuild])



This gives me as required 07/01/2015 in the query and when i select the BookedDate value the little calendar icon appears which I presume confirms it’s classed as a date field.

When I convert the select query over to an Append query and assign the BookedDate to the required table field and run it I get an Enter Parameter window asking for the DateBookedBuild value which i didn't get when it was a select query.



I feel I have over complicated a simple matter? Help… what I am I missing?



Thanks

Another CDate() question

Filter view on current month

I want to create a view that shows all items created in the current month. This is the datasource for a related items control.



I'm able to achieve this by using date functions in the where clause, but this doesn't perform very well. My guess is that it is evaluating this formula for every row in the data source. It performs much faster if I hard code a date.



Is there another way of achieving this? I have a variable in my OnStart macro that is set to the first day of the current month, but I don't think there is a way of using this variable in a query's WHERE criteria.



I see that queries can accept parameters, but not sure how I can set this.

Filter view on current month

Required field suddenly needed durning filter

I have a form that I have opening in Filter by Form mode. It WAS working flawlessly, at least it was opening in that mode. It IS still requiring me to click on Toggle Fields once data is entered into controls to filter by, but that's another issue (I wrote a recent comment, but haven't gotten any response). Something different is happening suddenly that wasn't happening before. This form is a copy of a form needed to enter data. Both forms read from a table which has several required fields. Suddenly, when I open the form to find records in ANY mode it's making me enter something into these required fields, even though I'm not searching/filtering by them. The message comes up "You must enter a value in the [Specific Required Field name here] Field." What did I do to make this start happening? How do I stop it? I DO want something to need to be entered in the required fields when new records are being entered and when things are being changed. However, I don't want it to be required during search processes. :banghead:

Required field suddenly needed durning filter

one to many delimma; variable in one cascading to the many

Hello, I need guidance. I have two tables, trans and detail, simple one to many. For every transaction (trans) there can be many expenses (details). There is a tax field in tans and in detail, in the event that a particular detail has tax and the other details are exempt. Most instances tax is entered one in trans for all of the details.



The problem is that when I query, say for example want to aggregate and analyze all activity on these tables; SELECT detail.expensetype, detail.amount, trans.tax FROM trans INNER JOIN detail on trans.tranid = detail.tranid, I have a tax item for every distinct detail type (since there can be man detail, expense types, for each transaction, or when theres > 1. I'm at a loss, how can I resolve this? I cant think of a solution other than allocating the tax over expense types (tran.tax/SELECT COUNT(detail.ID) FROM detail) or something of the like.



Any thoughts? Thank you in advance.

one to many delimma; variable in one cascading to the many

Searching For A Value In A Column Row Using The "In" Clause

Is there anyway to search each row within one column for a value ? The "IN" clause appears not to work for multiple values in a row.





SELECT Table_Payee_List.CategoryIDs, Table_Payee_List.PayeeSelectBox INTO GOTIT

FROM Table_Payee_List

WHERE (((Table_Payee_List.CategoryIDs) In ("25")));





Data (two columns with 5 rows) are represented below:



Payee CategoryIDs

Column Column



John Doe 21, 27, 32, 34, 44 - Row 1

Jane Doe 20, 25, 28, 42, 44 - Row 3

Paul Doe 19, 25, 28, 42, 44 - Row 3

James Doe 56, 29, 31, 62, 54 - Row 4

Amy Doe 24, 25, 29, 42, 74 - Row 5

Searching For A Value In A Column Row Using The "In" Clause

Textbox displaying the Min()

Hi guys,



I have a blank form, and it has two textboxes which are meant to show



1) from date

2) thru date



in the control source of my first textbox, I put in....

Code:



=Min([TEST].[Dates])


but I'm getting ERROR in that textbox. Basically I want to just find the smallest date in the column "Dates".



The query "TEST" basically returns a list of dates, and the min() will obviously return the smallest of it, but it is currently not.



Can someone help me?



Thanks

Textbox displaying the Min()

Primary Display Field in Autocomplete controls

What do you need to do to make a field available as the Primary Display Field in an Autocomplete control?



The table in the Autocomplete control's Row Source has a number of short text columns, but only one of them is available in the drop down list for Primary Display Field.

Primary Display Field in Autocomplete controls

Remove special characters

I've come across a slight problem and was wondering what approaches others have used to solve it...



I have a Memo field that is used to be a description of a document. I don't know what the user will put in (could be anything), but it is eventually passed in a string to a query, etc.



The problem: I discovered during testing that if an apostrophe is entered (Ex: This document explains how to deal with Joe's pleasant disposition.), it breaks my code. I then realized that all reserved words and characters would cause this problem.:banghead:



I can get around this one just by using Replace(str, "'", "''"). However, I know there are others that will cause problems, and I don't want to end up with a string of replace statements just to fix them. Any advice?



Thanks in advance!

Remove special characters

Question Entering data into a form

Here is one for you brain boxes...

I have a form into which I scan a serial number in one of its text boxes, I can then select search and am presented with a report relating to that serial number. All simple so far. Now for the dilemma... The barcode I scan consists of 15 characters like so, 53423PP98765432, numbers-PP-numbers.. the problem I have is that I only need the numbers after the PP's, in other words the last 8 digits. My question is, is there something I could do to make the text box omit the first 7 characters automatically, leaving me with the 8 I need, instead of me having to curser into the middle and manually delete the first 7 characters. I only need the last 8 because of the link with another database that only uses the last 8 digits.



Also, on the device I scan, there are 2 other barcodes, above and below the one I need to scan. If I scan one of the others by mistake, I have to highlight and delete the results to try and scan the middle barcode. The other barcodes also have a different length to the one I need. So is it possible to write some code that says, ok, you have scanned a barcode with 10 or 12 digits, we don't want either of those, so deletes it for me to try again, but then recognises the 15 digit barcode and auto deletes the first 7 characters as mentioned above.



I'm praying that one of you super clever guys or gals can help me with this. Thanks in advance.



Iann

Question Entering data into a form

How to refresh a field automatically?

Hi All,



I have a form which has a field named VendorID it gets data from the following query



SELECT TOP 2 V.VendorID, V.VendorName, COUNT(A.ClaimNumber) AS Total_assignment, V.VendorStatus

FROM dbo.VendorMaster V LEFT OUTER JOIN

dbo.VendorAssignment A ON V.VendorID = A.VendorID

GROUP BY V.VendorID, V.VendorName, V.VendorStatus

HAVING (V.VendorStatus = N'Active')

ORDER BY COUNT(A.ClaimNumber)



So, if we look at the code it should give me top 2 by ascending , but whats happening here is once i refresh it gives me top 2 and it stays the same until and unless i go to view mode and come back to the form mode( refresh) again. Can someone please help me with the automatic code or something which can make this one update automatically?



Thanks a lot for your help.

How to refresh a field automatically?

auto insert date when anothe field is changed.

On my form have a status field with about 7 options to choose from a combo box, i have these values set in another table. What i would like is for my other field, which is a date, to automatically change whenever the status field is changed. So i know how long ago the status field was set. So basically if i change the status to complete i want the date to then set the date and time now.

Can anyone help?

Thanks

auto insert date when anothe field is changed.

Cannot run Union query

Hi all,



I have created a union query which joins together multiple queries into one. It was working fine until I added more than 6 queries. Now I am getting an error message saying "Could not start transaction; too many transactions already nested." I looked this up and the description said that I could not nest a transaction more than 5 levels deep. This should only be a single level deep. I tried to create union queries (from only 6 tables each) and then joined those together and it worked fine but not if I try to join them using a single union query. Additionally, I looked up the maximum number of tables allowed and 6 is well below the limit of 32 (what I found). I was wondering, is this issue because one of the fields I have included is a multivalue lookup field?



Here's what my SQL code looks like.



SELECT [210-XXXX-XXX].[Product Code], [210-XXXX-XXX].DwgNo, [210-XXXX-XXX].Title, [210-XXXX-XXX].Rev

FROM [210-XXXX-XXX]

WHERE ((([210-XXXX-XXX].[Product Code])=[Forms]![Open PRF].[Product Code]))

UNION

SELECT [270-XXXX-XXX].[Product Code], [270-XXXX-XXX].DwgNo, [270-XXXX-XXX].Title, [270-XXXX-XXX].Rev

FROM [270-XXXX-XXX]

WHERE ((([270-XXXX-XXX].[Product Code])=[Forms]![Open PRF].[Product Code]))

UNION

SELECT [7400-XXXX].[Product Code].Value, [7400-XXXX].DwgNo, [7400-XXXX].Title, [7400-XXXX].Rev

FROM [7400-XXXX]

WHERE ((([7400-XXXX].[Product Code].Value)=[Forms]![Open PRF].[Product Code]))

UNION

SELECT [950-XXXX].[Product Code].Value, [950-XXXX].DwgNo, [950-XXXX].Title, [950-XXXX].Rev

FROM [950-XXXX]

WHERE ((([950-XXXX].[Product Code].Value)=[Forms]![Open PRF].[Product Code]))

UNION

SELECT [951-XXXX].[Product Code].Value, [951-XXXX].DwgNo, [951-XXXX].Title, [951-XXXX].Rev

FROM [951-XXXX]

WHERE ((([951-XXXX].[Product Code].Value)=[Forms]![Open PRF].[Product Code]))

UNION

SELECT [ALL PRODUCTS].[Product Code], [ALL PRODUCTS].[PRF Document], [ALL PRODUCTS].[PRF Description], [ALL PRODUCTS].[PRF Rev]

FROM [ALL PRODUCTS]

WHERE ((([ALL PRODUCTS].[Product Code])=[Forms]![Open PRF].[Product Code]))

UNION SELECT [ALL PRODUCTS].[Product Code], [ALL PRODUCTS].[ISR Document], [ALL PRODUCTS].[ISR Description], [ALL PRODUCTS].[ISR Rev]

FROM [ALL PRODUCTS]

WHERE ((([ALL PRODUCTS].[Product Code])=[Forms]![Open PRF].[Product Code]));



When it's written like this, it doesn't work right but if I delete any one query (or table) from the group, then it works fine. Is there a way to make a single union query without having to make the intermediate union queries? Appreciate any help that can be provided.

Cannot run Union query

Hello world

Hi all,



I'm new to this forum and somewhat new to access. I've been tinkering with it for about a month now but I've been able to learn a lot about how it works and how databases work in general. It's nice to be able to learn some harder things as I am very picky with certain features and functionalities and I noticed that access is capable of doing a lot of different things if you know how to use it properly.

Hello world

Hello world

Hi all,



I'm new to this forum and somewhat new to access. I've been tinkering with it for about a month now but I've been able to learn a lot about how it works and how databases work in general. It's nice to be able to learn some harder things as I am very picky with certain features and functionalities and I noticed that access is capable of doing a lot of different things if you know how to use it properly.

Hello world

Vba Code - (when) Are Brackets Needed

BilledCount = DCount("Customer", "HoursBilled", "[Customer] = [pickcustomer] And [friday] = [pickdate] And [employee] = [pickemployee]")



In the code above, could it be simplified ??

Vba Code - (when) Are Brackets Needed

Sub sub form referencing

Database help needed. Ok. Putting it out there. I need some help. I've googled till I'm blue in the face - literally.



I have a sub form within a sub form and I need to reference a combo box on the sub form. Access only seems to write to the first sub form level.



Here's my syntax:



[forms]![Mainformname]![1st.subform].[form]![2nd.subform]![combobox]



This is a macro - after update event.



The problem is, access shows you the 2nd subform, but, I can't seem to be able to reference any of the controls on it????



The reference is so that the combo box will filter based on a synched combo box's selection which runs a requery event.



Anyone out there who knows the answer, please, please, save me some more hours of reading - thanks in advance.

Sub sub form referencing

logic question on table/form layout

ok guys

what I have is 5 (or more) options

lets say its fruit (Apple Pear Cherry Orange and Pineapple )

I have these in a table (its not fruit) and I have coded each with a reference

11,12,13,14, and 15



what I had in mind in another form/table is once 11-15 is selected (and only one per record) is that the questions that apply to that option are made available



I had in mind (rightly or wrongly) in the underlying table to get the questions that apply to the option



So Apple (could have up to 5 questions ) selected and Dlookup questions code11 in a questionsettable and put these questions in my main table (answers will always be yes or no ) depending on the answer it will do stuff (which will also be stored in my question set table )



I have kept this simple ( the questions below are examples - and the actual questions will not actually relate to each other (all apple questions could be Green Y/N or large enough and some could be straight statments that warrant an answer (ie have all the questions been answer - or are you happy with the apple ( the pear question may only have 1 question -but the max number of questions for any one selection is 5 questions)





Apple-

Q1 - Is it Green ? Y/N (yes -buy it) (no reject it)

Q2 - is it large enough ? Y/N (yes -buy it) (no reject it)

Q3 is it rotten ? (Y/N) (Yes reject it ) (no buy it)

logic question on table/form layout

multi page report

Hi all, I'm not sure if i'm going about this the right way but I have a multi page report(8 pages) that needs some data overlayed on the first page. Right now I'm inserting the Word doc into the report as an OLE Unbound Object but you can only insert a page at a time so it won't fit in one report.



Any ideas how to do this more efficiently? The data that is being overlayed is from an Access table.



TIA

Ted

multi page report

Join Error Help

What I have

3 tables

Projects

Tasks

Owners

Tasks are linked to Projects via FK (Project PK)

Both Tasks and Projects have FKs, that are the Owners PK.



I am trying to create a query to be used to build a report where Tasks are grouped by Project, and each Project and Task Owner is also shown.



My query skills are the most meager of my already meager Access skills, so I have been fighting with getting a working query all morning. Any help is greatly appreciated.

Join Error Help

Reports are showing errors in the data fields

Hello all,



I have a report (upholstery orders) that shows times, quantities and orders details ect. I open this report from a dashboard navigation form using a button (easy enough).

The report opens fine, all data fields/box's/records show up fine and accurate. I have written macro's so that when certain fields (Sales and Works order numbers) are clicked they open another report displaying the necessary information based on the selected fields Data. This again opens fine (no drama's), however, if I then close that form or simply return to the original report (upholstery orders) using the tabs, various fields/records containing data now show "#Error" (which is a slight pain).



If I close the original form and open it again the errors naturally disappear for a while until I move away from it again. I understand there is more pressing and more imaginative problems regarding Access, as it's simple enough to close and reopen, I just wondered if there was any error or requery based solution I can apply to my report, in order to save my colleagues some of that most valued theoretical commodity, time.



Thanks in advance.

Reports are showing errors in the data fields

Hello all

Used to look after a number of Access 2000 and 2007 desktop databases in my last role some 3+ years ago.



Now getting in to Access 2013 Web Apps on SharePoint 2013 which so far appear to be a very different kettle of fish so may well see you over in the Web App forums :)

Hello all

enabling cascading comboboxes in datasheet or continuous form

Having been asked about this recently, I reinvented some code I developed to work with datasheets and which also works with continuous and single forms.



The attachment was developed in 2010 but saved as 2003.



The db demonstrated two techniques for using cascading comboboxes.



Technique 1 is the simpler one and is used where the combobox displays the bound column after updating



Technique 2 is slightly more complex and is used when the bound column is not displayed after updating - which is frequently the case. However it can also be used in place of technique 1



Note that all the comboboxes need to be bound (in order to retain the values selected for each record). However if used in a continuous/datasheet form in dataentry mode or a single form, they do not need to be bound.




Attached Files





File Type: mdb ContinuousCascadingCombo.mdb (448.0 KB)



enabling cascading comboboxes in datasheet or continuous form

Inserting a function within a sub in VBA

I need help fixing this code. I am new at VBA in access and I am working on an application I didn't develop but I am maintaining.




Code:



Private Sub Command122_Click()

Dim formName As String



formName = getFormName(tblName)



DoCmd.OpenForm (formName)

DoEvents

Forms(formName).FilterOn = False

Forms(formName).Combo94.Value = (myreference)

Forms(formName).Filter = "DeptID = '" & Forms(formName).Combo94.Value & "'"

Forms(formName).FilterOn = True

Forms(formName).Controls(fieldName).SetFocus

DoCmd.Close acForm, Me.Name

End Sub







Public Function myreference() As String



SELECT ID FROM tblSiteInfo WHERE ( DeptID = " & DeptID & " )

End Function



I am trying to to write afunction that translates the deptid into a table 'id (myreference)



Thanks in advance

Inserting a function within a sub in VBA

[SOLVED] LOG AND CODE Formula

Dear All Expert MS Access



With regard,

in MS Access I have a table and want to make a code to enter the formula in the query, but I have not used multiple functions into one

as an example of a query in addition to its



please would anyone can help



thank you



Regards, Ira Borneo




Attached Files





File Type: xls LOG AND CODE Formula.xls (33.5 KB)



[SOLVED] LOG AND CODE Formula

Add a filter to a subform

I am trying to apply a filter to a subform but don’t know how to go about it.

I have three tables as follows:





ITEM (primary key Item ID) (AutoNumber)





CREATOR (Primary key Creator ID) (AutoNumber)





ITEM CREATOR (junction table) (primary key Item ID and Creator ID)





ITEM has a one to many relationship with ITEM CREATOR.

CREATOR has a one to many relationship with ITEM CREATOR.





I have added a subform to the data entry form for ITEM. The fields in the subform are the fields in the ITEM CREATOR table, i.e. Item ID and Creator ID. The purpose of the subform is to link an Item to a Creator and populate the ITEM CREATOR table.





These are the subform properties:





Record Source: Item Creator subform

Link Master Fields: Item ID

Link Child Fields: Item ID





The subform contains a combo box for Creator ID. These are the properties.





Control Source: Creator ID

Row Source: Item Creator Subform query

Bound Column: 1

Column Count: 9





When a user clicks on the combo box drop-down, the first 9 fields in the CREATOR table are displayed. The purpose of this is to give the user more information when linking ITEM to CREATOR, so that the correct Creator ID is chosen and the Item is linked to the correct Creator. Two of these fields are Creator Surname and Corporate Creator.





This works well.





The issue is that CREATOR now contains over 2500 records. When trying to link an Item to a Creator the drop-down list that appears when the Creator ID combo box is clicked is very long and the user is potentially faced with a long time spent scrolling the list. This is not very user-friendly.





I would like to filter the drop-down list by Creator Surname so that the user enters a surname and only the Creator IDs for the Creators that have that surname appear in the list.





In addition, I would like to filter the list by Corporate Creator.





I hope that the above makes sense. I would much appreciate any help.

Add a filter to a subform

Labels