Hi Johnny,
Just to confirm:
On your form, you have all the textboxes needed,
All the textboxes' format property is set to 'Currency'
And all the records in rst exist
Really not too sure what to suggest. If you like, you could send me all you have by email and I'll take a proper look at it...
Try this
In the Form_Load Event:
Application.SetOption "Move After Enter", 0
Then to change back on Form_Close
Application.SetOption "Move After Enter", 1
It seems like sometimes the function returns "" and other times returns Null. Give this a try:
GetTotal = Format(IIf(rst.GetString = "" Or IsNull(rst.GetString), 0, rst.GetString), "Currency")
Fingers crossed!
Hi,
First up to make the code easier, rename your textboxes to txt_Monday, txt_Tuesday . . .
then this code should do what you're looking for:
Private Sub Form_Load()
Dim strDay As String
strDay = Format(Date, "DDDD")
Me.Controls("txt_" & strDay).Visible = True...
I'm hoping I'm not the only programmer to have been pulling my hair out over errors only to find out it's a simple typing error. Happens to us all.
Might not be the answer to the question, just noticed it and thought I'd mention it.
Hi Vespertin,
I'm guessing that your combo control is called 'Description' If so then instead of in the default Property, Type in to the actual textbox in Design view.
=[Description].[Column](2)
Hope this helps.
Hi,
I think I've solved it. When the rst.getstring returns a null value, is it actually null, or is it ""
If it's "" then use
GetTotal = Format(IIf(rst.GetString = "", 0, rst.GetString), "Currency")
Other than that I'm running out of ideas!
Can't seem to get my head around this one. I think it'll need to be coded into a form so that the location string can be split.
It's a pretty complex thing you're trying to do.
This is only a quick solution but should point you in the right direction.
The Form has bound data to the Users Table, and 1 unbound textbox for the address.
When the Address is changed, the code will search for the address and update the address_ID
Been going round in circles with this one. I think I know what you are trying to achieve but doing this within the tables is not going to be easy.
My assumption is that if ZE is in Location ABCD the weight would be the same as it would be in location AD but not if it was in CD.
Am I getting...
Oh, I wasn't aware of that! I've always coded that way without errors. Maybe just been lucky up until now.
And just tested it too. You are right! Thanks for the tip.
In the table design view there is an option for a Calculated Field which you can use to lookup values from the table. I'll have a play and see what I can come up with for you.
Not quite sure if this is what you were looking for, but I would probably put the addressID in the Users table and then not have the User_Addresses table. Then create the relationship between those 2 tables.
Sorry, forgot how to format this correctly
Try replacing:
GetTotal = Nz(Format(rst.GetString, "Currency"), 0)
With
GetTotal =Format(Nz(rst.GetString, 0), "Currency")
and the & "" doesn't appear to have any relevance
I figured out how to do it with code, but couldn't do it with queries. If you're interested then here's what I came up with.
Sub Update_Employees()
Dim strFullName, FName, SName As String
Dim RS, RSE As Recordset
Dim Nms As Variant
Dim NmeCount As Integer
Set RS =...