Keep the subfrom from autosaving when lost focus?

I have a main form with subform. In the subform, it includes a submit and clear all button that allows users submit when ready or clear all if they don’t have all the information in hand.

Now the problem is, if the user forgets to hit clear all and clicks anywhere outside of the subform it automatically saves the entries.

How do I prevent that from happening?

Thank you! Much appreciated!

submitted by /u/NationalDonut
[link] [comments]

Posted on

Question regarding composite keys

I am setting a database to help track bills of lading to match them with invoices and then code them with the appropriate general ledger numbers.

Right now when inputting the tickets you input the department(gl_dep), the MaterialID(gl_account), the FreightID(also gl_account), the Supplier(SupplierID), and the Shipper(ShipperID). This has a one to many relationship with another table that has the tickets and the quantity of the tickets.

I have another table which has gl_dep, gl_account and companyid. There is a single value (gl_desc) that matches with the combinations of gl_dep, gl_account and company id. The same MaterialID and FreightID both lookup from the same field, as do the SupplierID and ShipperID.

I planned on using two seperate queries to take the autonumber from the first table and the materialid, supplierid and gl_dep to get the gl_desc from the second table. And do the same thing for supplierid, freightid and gl_dep. Is it better to do this with a composite key or should I try to figure out a way to use a surrogate key?

My initial attempt was just to match the related fields in the relationships tab but I found the query got the correct results when it was first created but running it again in the same query returned all possible gl_desc values and not the correct one. Would love any advice!

submitted by /u/mbkeith615
[link] [comments]

Get the best Microsoft Access conultant

Get the best Microsoft Access programmer

Posted on

Access Related tables

I am beyond confused about what it means to “create 2 related tables”. I have asked my prof and she is no help.
So far I have created a database. I do not understand what a good primary key would be and then to get it to relate to another table. I look online and they bring up a foreign key to go with a primary. The database is suppose to be for albums, I created that, I just don’t understand what a good primary key would be and if I need a foreign key or not. I am trying hard to understand this.
So, when you create a related table, you’re supposed to create using the Table Design? I don’t understand what to put in there for the primary key to match up. I keep getting a message about “no unique index found for the referenced field of the primary table”. Am I supposed to enter more information? Should my database ID match with the other tables?
Please help. I am sure I can get it but a two week crash course in this doesn’t seem like enough time to learn it.
Thank you

  • Create at least 2 related Tables.
  • Choose what your primary key will be.

submitted by /u/DismissaloftheHeart
[link] [comments]

Posted on

How do I get the width of a text box?

I have an auto updating textbox that varies in width and I’m trying to get the line below it to resize with the text box. This is as far as I’ve gotten.

Private Sub Command870_Click() Dim lineW As Double lineW = Auto_Title0.Width lineTitle.Width = lineW End Sub 

So for some reason and I can’t figure out where the number comes from so it must be converted to another unit of measurement that I don’t know of but instead of inches it turns out to always be the same number no matter how many times I click the button.

4350 but the Width is 3.0208″.

Anyone know a way to get that value converted to inches or whatever that unit of measurement used when changing the line’s width?

Edit:

I know this is a bit messy but I’m still working on some borrowed code and my own so it hasn’t even gotten cleaned up yet.

Private Sub Command870_Click() Dim name As String Dim fontSize As Integer Dim intChars As Integer Dim intTwips As Integer Dim titleWidth As Double Dim autoTitle As Double Dim lineWidth As Double Dim totalWidth As Double name = Nz([First Name] & " " & [Last Name], "Untitled") fontSize = Auto_Title0.fontSize intChars = Len(name) ' how many chars in the label intTwips = 1440 ' might depend on what font you are using titleWidth = (intChars * fontSize) totalWidth = titleWidth Auto_Title0.Width = totalWidth lineTitle.Width = totalWidth autoTitle = Auto_Title0.Width lineWidth = lineTitle.Width Debug.Print "Name: "; name Debug.Print "Font Size: "; fontSize Debug.Print "Characters: "; intChars Debug.Print "Total Width: "; titleWidth End Sub 

Where I’m running into a dead end with this as I’m trying to get the text box to expand based on the number of characters in it and the font size I’m using. I am just not able to wrap my head around the formula to get this sorted out. I thought twips would help but there is always an overflow and the number it produces would be much too large anyways. In the debug print below

Name: FirstName LastName Font Size: 24 Characters: 18 Total Width: 432 

I’m not sure where I’m going wrong with my math here. I know I’m missing something but I really thought taking the number of characters and multiplying it by the font size would get me my width.

submitted by /u/TakeBeyond
[link] [comments]

Get the best Microsoft Access conultant

Get the best Microsoft Access programmer

Posted on

How To Fix Access Date Picker Not Showing Issue

Does your MS Access Date Picker stopped working or Date Picker Not Showing? Don’t have any ideas on how to fix Access date picker missing mystery? Leave all your tension, as in our today’s topic we will discuss this specific…

Posted on

Possible Bug – Dates converting to number/text

Is this a known bug? I have a 32-bit MS Access application which has been working perfectly on 32-bit Office installed on 32-bit or 64-bit Windows 7, 8, and 10 OS.

Recently, we had new DELL PCs running Win 10 Pro 64-bit and pre-installed Office 2013 and 2016 64bit. I normally install Office 2010 32-bit and uninstall other office versions to run the app. It usually works fine.

But now, entry into Date Columns has now been affected, after the clicking the date selector to enter, a pop up says the entry is incorrect data type. So I tried to do it using INSERT queries instead. Copied an existing row into Excel as a template for data, and when I converted the record to text, the date eg. 19/06/2000 converts to 36696. So I figured this is probably an issue in both Access and Excel, that dates are converted into these integers.

I’ve tried uninstalling other office versions but nothing helps resolve this. The application used to work under this setup before Win 10 64 bit, Office 2010 Pro 32-bit. Is there something else causing this?

submitted by /u/obsessionfreak
[link] [comments]

Posted on

How do I get the width of a text box?

I have an auto updating textbox that varies in width and I’m trying to get the line below it to resize with the text box. This is as far as I’ve gotten.

Private Sub Command870_Click() Dim lineW As Double lineW = Auto_Title0.Width lineTitle.Width = lineW End Sub 

So for some reason and I can’t figure out where the number comes from so it must be converted to another unit of measurement that I don’t know of but instead of inches it turns out to always be the same number no matter how many times I click the button.

4350 but the Width is 3.0208″.

Anyone know a way to get that value converted to inches or whatever that unit of measurement used when changing the line’s width?

Edit:

I know this is a bit messy but I’m still working on some borrowed code and my own so it hasn’t even gotten cleaned up yet.

Private Sub Command870_Click() Dim name As String Dim fontSize As Integer Dim intChars As Integer Dim intTwips As Integer Dim titleWidth As Double Dim autoTitle As Double Dim lineWidth As Double Dim totalWidth As Double name = Nz([First Name] & " " & [Last Name], "Untitled") fontSize = Auto_Title0.fontSize intChars = Len(name) ' how many chars in the label intTwips = 1440 ' might depend on what font you are using titleWidth = (intChars * fontSize) totalWidth = titleWidth Auto_Title0.Width = totalWidth lineTitle.Width = totalWidth autoTitle = Auto_Title0.Width lineWidth = lineTitle.Width Debug.Print "Name: "; name Debug.Print "Font Size: "; fontSize Debug.Print "Characters: "; intChars Debug.Print "Total Width: "; titleWidth End Sub 

Where I’m running into a dead end with this as I’m trying to get the text box to expand based on the number of characters in it and the font size I’m using. I am just not able to wrap my head around the formula to get this sorted out. I thought twips would help but there is always an overflow and the number it produces would be much too large anyways. In the debug print below

Name: FirstName LastName Font Size: 24 Characters: 18 Total Width: 432 

I’m not sure where I’m going wrong with my math here. I know I’m missing something but I really thought taking the number of characters and multiplying it by the font size would get me my width.

submitted by /u/TakeBeyond
[link] [comments]

Get the best Microsoft Access conultant

Get the best Microsoft Access programmer

Posted on

Question on Split Databases

I am using Microsoft Access to process attendance to automatically calculate wages of employees. Due to the large volume of attendance records every month, there are often mistakes in the input of data. Hence, it is crucial for my users to be able to edit the attendance from the table. However, I read that the front end of the database contains only the queries, forms, reports, macro, etc but the tables are stored in the back end. Hence, the question: will my users be able to view and edit the attendance records that they input from the front end database? If they are able, how do I make it so? Thank you!

TL;DR: Are front end users able to view and edit the records they had previously input?

submitted by /u/TheKnight119
[link] [comments]

Get the best Microsoft Access conultant

Get the best Microsoft Access programmer

Posted on

Issue with forms suddenly not appearing when opened in form view

This issue manifested seemingly out of nowhere. One minute the database was functioning fine, the next, forms (pop up, modal forms) weren’t displaying and resulted in me having to close and re-open the database as it would not let me exit out of form view. Since I can’t see the form, I can’t change the view and I just have to exit the database. Has anyone experienced this before? Any solutions? I combed through VBA and there doesn’t appear to be any code that might loop infinitely or cause the database to crash but I’m not 100. Is it possible that buttons with no assigned code could cause an issue? Is not putting code behind certain objects possibly the cause? Appreciate any insight. I’m still a bit of a novice when it comes to Access and code in general, so maybe I made a common mistake that I’m not catching or noticing. Cheers!

submitted by /u/CapRavOr
[link] [comments]

Posted on